shaofengshi commented on code in PR #5610:
URL: https://github.com/apache/gravitino/pull/5610#discussion_r1870560657
##########
clients/cli/src/main/java/org/apache/gravitino/cli/commands/Command.java:
##########
@@ -73,11 +109,22 @@ protected GravitinoClient buildClient(String metalake)
throws NoSuchMetalakeExce
* @return A configured {@link GravitinoAdminClient} instance.
*/
protected GravitinoAdminClient buildAdminClient() {
+ Builder<GravitinoAdminClient> client = GravitinoAdminClient.builder(url);
+
if (ignoreVersions) {
- return
GravitinoAdminClient.builder(url).withVersionCheckDisabled().build();
- } else {
- return GravitinoAdminClient.builder(url).build();
+ client = client.withVersionCheckDisabled();
}
+ if (authentication != null) {
+ if (authentication.equals("simple")) {
+ if (userName != null && !userName.isEmpty()) {
+ client = client.withSimpleAuth(userName);
+ } else {
+ client = client.withSimpleAuth();
+ }
+ }
Review Comment:
If user typed a wrong value for the auth parameter, and then the CLI just
ignore that, it will lead to unexpected behavior, which will be difficult for
the user to debug. That is my point: when an unrecognized input received,
should we just ignore that, or give some error or warning?
--
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]