You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/07/09 15:27:37 UTC

[GitHub] [kafka] ijuma commented on a change in pull request #10811: KAFKA-12598: remove zookeeper support on configCommand except security config

ijuma commented on a change in pull request #10811:
URL: https://github.com/apache/kafka/pull/10811#discussion_r667031473



##########
File path: core/src/test/scala/unit/kafka/admin/ConfigCommandTest.scala
##########
@@ -60,6 +59,48 @@ class ConfigCommandTest extends ZooKeeperTestHarness with Logging {
       "--add-config", "security.inter.broker.protocol=PLAINTEXT"))
   }
 
+  @Test
+  def shouldExitWithNonZeroStatusOnZkCommandWithTopicsEntity(): Unit = {
+    assertNonZeroStatusExit(Array(
+      "--zookeeper", zkConnect,
+      "--entity-type", "topics",
+      "--describe"))
+  }
+
+  @Test
+  def shouldExitWithNonZeroStatusOnZkCommandWithClientsEntity(): Unit = {
+    assertNonZeroStatusExit(Array(
+      "--zookeeper", zkConnect,
+      "--entity-type", "clients",
+      "--describe"))
+  }
+
+  @Test
+  def shouldExitWithNonZeroStatusOnZkCommandWithIpsEntity(): Unit = {
+    assertNonZeroStatusExit(Array(
+      "--zookeeper", zkConnect,
+      "--entity-type", "ips",
+      "--describe"))
+  }
+
+  @Test
+  def shouldExitWithNonZeroStatusOnZkCommandAlterUserQuota(): Unit = {

Review comment:
       This says ZkCommand, but the test uses --bootstrap-server.

##########
File path: core/src/test/scala/unit/kafka/admin/ConfigCommandTest.scala
##########
@@ -290,14 +340,9 @@ class ConfigCommandTest extends ZooKeeperTestHarness with Logging {
     assertEquals("[[1, 2], [3, 4]]", addedProps.getProperty("nested"))
   }
 
-  def doTestOptionEntityTypeNames(zkConfig: Boolean): Unit = {
-    val connectOpts = if (zkConfig)
-      ("--zookeeper", zkConnect)
-    else
-      ("--bootstrap-server", "localhost:9092")
-
+  def doTestOptionEntityTypeNames(): Unit = {

Review comment:
       This should be inlined into the test since it's only used in one place? Also, the removed test is no longer needed, I assume?

##########
File path: core/src/main/scala/kafka/admin/ConfigCommand.scala
##########
@@ -876,6 +872,11 @@ object ConfigCommand extends Config {
         throw new IllegalArgumentException(s"--bootstrap-server must be specified for --all")
       }
 
+      if (options.has(zkTlsConfigFile) && options.has(bootstrapServerOpt)) {
+        throw new IllegalArgumentException("--bootstrap-server doesn't support --zk-tls-config-file option. " +
+          "Please use --zookeeper option instead")

Review comment:
       Is this error only printed for cases that are _not_ supported by `--bootstrap-server`? For example, if both `--bootstrap-server` and `--zk-tls-config-file` are configured and you are trying to do something that is supported by `--bootstrap-server`, the message should suggest removing `--zk-tls-config-file` instead.

##########
File path: core/src/test/scala/unit/kafka/admin/ConfigCommandTest.scala
##########
@@ -850,22 +890,19 @@ class ConfigCommandTest extends ZooKeeperTestHarness with Logging {
   }
 
   @Test
-  def shouldAddBrokerQuotaConfig(): Unit = {

Review comment:
       We have a `shouldAddBrokerQuotaConfig` test with bootstrap-server?




-- 
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-unsubscribe@kafka.apache.org

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