Icewind52 commented on code in PR #24247:
URL: https://github.com/apache/kafka/pull/24247#discussion_r4635798550


##########
tools/src/main/java/org/apache/kafka/tools/ConfigCommand.java:
##########
@@ -248,13 +250,21 @@ static void alterConfig(Admin adminClient, 
ConfigCommandOptions opts) throws IOE
                     validateBrokerId(entityName, entityType);
                 }
                 configResourceType = ConfigResource.Type.BROKER;
-            } else {
+            } else if (GROUP_TYPE.equals(entityType)) {
                 configResourceType = ConfigResource.Type.GROUP;
+            } else if (CLUSTER_MIRROR_TYPE.equals(entityType)) {

Review Comment:
   Thanks! It's always true since the outer if only accepts these 5 entities 
today.
   However @fvaleri suggested keeping the explicit branch plus a catch-all (see 
the earlier 
[thread](https://github.com/apache/kafka/pull/24247#discussion_r4629606950)) so 
that if a new type is added to the outer if without its own branch, it fails 
with a exception instead of silently becoming CLUSTER_MIRROR. This matches the 
pattern in describeResourceConfig. 
   
   wdyt @fvaleri ?



-- 
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]

Reply via email to