majialoong commented on code in PR #20638:
URL: https://github.com/apache/kafka/pull/20638#discussion_r2485286304
##########
tools/src/main/java/org/apache/kafka/tools/ConnectPluginPath.java:
##########
@@ -192,6 +200,21 @@ private static Set<Path> parseLocations(ArgumentParser
parser, Namespace namespa
return pluginLocations;
}
+ private static void validatePluginPath(String pluginPath, String
configName) throws ConfigException {
+ String trimmed = pluginPath.trim();
+ if (trimmed.isEmpty()) {
+ throw new ConfigException("'" + configName + "' must not be
empty.");
+ }
+
+ String[] pluginPathElements = COMMA_WITH_WHITESPACE.split(trimmed, -1);
+
+ for (String path : pluginPathElements) {
Review Comment:
Thanks for your review. In the current `WorkerConfig`, the `plugin.path`
config is defined as not allowing empty values.
https://github.com/apache/kafka/blob/8900a1870354755283a5ed610e0b1420eca5e912/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConfig.java#L227-L232
In `ValidList#ensureValid`, it first validates whether the value itself is
empty.
https://github.com/apache/kafka/blob/8900a1870354755283a5ed610e0b1420eca5e912/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java#L1043-L1047
Then it validates whether each individual item is empty through the
`validateIndividualValues` method.
https://github.com/apache/kafka/blob/8900a1870354755283a5ed610e0b1420eca5e912/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java#L1059-L1069
So, I think the validation logic here is consistent with the validation
logic in the current configuration. You can take another look if you have time.
Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]