FrankYang0529 commented on code in PR #19306:
URL: https://github.com/apache/kafka/pull/19306#discussion_r2034706560
##########
tools/src/test/java/org/apache/kafka/tools/DelegationTokenCommandTest.java:
##########
@@ -81,6 +92,27 @@ public void testDelegationTokenRequests() throws
ExecutionException, Interrupted
}
+ @ClusterTest(types = { Type.KRAFT },
+ brokerSecurityProtocol = SecurityProtocol.SASL_PLAINTEXT,
+ controllerSecurityProtocol = SecurityProtocol.SASL_PLAINTEXT,
+ serverProperties = {
+ @ClusterConfigProperty(key = DELEGATION_TOKEN_SECRET_KEY_CONFIG,
value = "key")
+ })
+ public void
testDescribeDelegationTokenWithBootstrapController(ClusterInstance
clusterInstance) throws ExecutionException, InterruptedException {
Review Comment:
This test case is about Admin. We need another test case to test
DelegationTokenCommand directly.
##########
tools/src/main/java/org/apache/kafka/tools/DelegationTokenCommand.java:
##########
@@ -202,14 +206,20 @@ static class DelegationTokenCommandOptions extends
CommandDefaultOptions {
public DelegationTokenCommandOptions(String[] args) {
super(args);
- String bootstrapServerDoc = "REQUIRED: server(s) to use for
bootstrapping.";
+ String bootstrapServerDoc = "REQUIRED: server(s) to use for
bootstrapping. When the --bootstrap-controller argument is used
--bootstrap-servers must not be specified.";
String commandConfigDoc = "REQUIRED: A property file containing
configs to be passed to Admin Client. Token management" +
" operations are allowed in secure mode only. This config
file is used to pass security related configs.";
this.bootstrapServerOpt = parser.accepts("bootstrap-server",
bootstrapServerDoc)
.withRequiredArg()
.ofType(String.class);
+ this.bootstrapControllerOpt =
parser.accepts("bootstrap-controller",
+ "REQUIRED: A
comma-separated list of bootstrap.controllers that can be supplied instead of
bootstrap-servers."
+ + " This is useful
for administrators who wish to bypass the brokers.")
+ .withRequiredArg()
Review Comment:
You cannot specify both `--bootstrap-server` and `--bootstrap-controller` as
required. This makes result like:
```
> ./bin/kafka-delegation-tokens.sh --bootstrap-controller localhost:9093
--describe
Missing required argument "[bootstrap-server]"
```
Please using `withOptionalArg` and do the check in `checkArgs`.
--
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]