ChengyanOo commented on code in PR #17507:
URL: https://github.com/apache/kafka/pull/17507#discussion_r1802773663


##########
core/src/main/scala/kafka/admin/ConfigCommand.scala:
##########
@@ -952,18 +919,13 @@ object ConfigCommand extends Logging {
       val hasEntityDefault = entityNames.exists(_.isEmpty)
 
       val numConnectOptions = (if (options.has(bootstrapServerOpt)) 1 else 0) +
-        (if (options.has(bootstrapControllerOpt)) 1 else 0) +
-        (if (options.has(zkConnectOpt)) 1 else 0)
+        (if (options.has(bootstrapControllerOpt)) 1 else 0)
       if (numConnectOptions == 0)
-        throw new IllegalArgumentException("One of the required 
--bootstrap-server, --boostrap-controller, or --zookeeper arguments must be 
specified")
+        throw new IllegalArgumentException("One of the required 
--bootstrap-server or --bootstrap-controller arguments must be specified")
       else if (numConnectOptions > 1)
-        throw new IllegalArgumentException("Only one of --bootstrap-server, 
--boostrap-controller, and --zookeeper can be specified")
-
-      if (options.has(allOpt) && options.has(zkConnectOpt)) {
-        throw new IllegalArgumentException(s"--bootstrap-server must be 
specified for --all")
-      }
-      if (options.has(zkTlsConfigFile) && !options.has(zkConnectOpt)) {
-        throw new IllegalArgumentException("Only the --zookeeper option can be 
used with the --zk-tls-config-file option.")
+        throw new IllegalArgumentException("Only one of --bootstrap-server or 
--bootstrap-controller can be specified")
+      if (options.has(zkTlsConfigFile)) {

Review Comment:
   I've made changes based on your comments.



##########
core/src/main/scala/kafka/admin/ConfigCommand.scala:
##########
@@ -113,22 +103,6 @@ object ConfigCommand extends Logging {
     }
   }
 
-  private def processCommandWithZk(zkConnectString: String, opts: 
ConfigCommandOptions): Unit = {
-    val zkClientConfig = 
ZkSecurityMigrator.createZkClientConfigFromOption(opts.options, 
opts.zkTlsConfigFile)
-      .getOrElse(new ZKClientConfig())
-    val zkClient = KafkaZkClient(zkConnectString, JaasUtils.isZkSaslEnabled || 
KafkaConfig.zkTlsClientAuthEnabled(zkClientConfig), 30000, 30000,
-      Int.MaxValue, Time.SYSTEM, zkClientConfig = zkClientConfig, name = 
"ConfigCommand", enableEntityConfigControllerCheck = false)
-    val adminZkClient = new AdminZkClient(zkClient)
-    try {
-      if (opts.options.has(opts.alterOpt))
-        alterConfigWithZk(zkClient, opts, adminZkClient)
-      else if (opts.options.has(opts.describeOpt))
-        describeConfigWithZk(zkClient, opts, adminZkClient)
-    } finally {
-      zkClient.close()
-    }
-  }
-
   def alterConfigWithZk(zkClient: KafkaZkClient, opts: ConfigCommandOptions, 
adminZkClient: AdminZkClient): Unit = {

Review Comment:
   I've made changes based on your comments.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to