jerqi commented on code in PR #3852:
URL: https://github.com/apache/gravitino/pull/3852#discussion_r1679251780
##########
catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/HadoopCatalogOperations.java:
##########
@@ -140,20 +177,20 @@ public void initialize(
private void initAuthentication(Map<String, String> conf, Configuration
hadoopConf) {
AuthenticationConfig config = new AuthenticationConfig(conf);
- String authType = config.getAuthType();
- if (StringUtils.equalsIgnoreCase(authType,
AuthenticationMethod.KERBEROS.name())) {
- hadoopConf.set(
- HADOOP_SECURITY_AUTHENTICATION,
- AuthenticationMethod.KERBEROS.name().toLowerCase(Locale.ROOT));
- UserGroupInformation.setConfiguration(hadoopConf);
- try {
- KerberosClient kerberosClient = new KerberosClient(conf, hadoopConf);
- File keytabFile =
kerberosClient.saveKeyTabFileFromUri(catalogInfo.id());
- this.kerberosRealm =
kerberosClient.login(keytabFile.getAbsolutePath());
- } catch (IOException e) {
- throw new RuntimeException("Failed to login with Kerberos", e);
- }
+ if (config.isKerberosAuth()) {
+ this.kerberosRealm =
Review Comment:
My fault.
--
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]