justinmclean commented on code in PR #5610:
URL: https://github.com/apache/gravitino/pull/5610#discussion_r1870579127
##########
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:
Auth is either null or "simple" it can have no other values as it is set via
a flag not passed as an argument. Any other unrecognized user input is caught
well before this, so if I did add an else the code in it would never be called.
--
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]