walterddr commented on a change in pull request #7702: 
[FLINK-11088][Security][YARN] Allow YARN to discover pre-installed keytab files
URL: https://github.com/apache/flink/pull/7702#discussion_r390733381
 
 

 ##########
 File path: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterDescriptor.java
 ##########
 @@ -887,20 +887,28 @@ private ApplicationReport startAppMaster(
                        }
                }
 
-               // setup security tokens
                Path remotePathKeytab = null;
+               String localizedKeytabPath = null;
                String keytab = 
configuration.getString(SecurityOptions.KERBEROS_LOGIN_KEYTAB);
                if (keytab != null) {
-                       LOG.info("Adding keytab {} to the AM container local 
resource bucket", keytab);
-                       remotePathKeytab = setupSingleLocalResource(
-                                       Utils.KEYTAB_FILE_NAME,
+                       boolean requireLocalizedKeytab = 
flinkConfiguration.getBoolean(YarnConfigOptions.SHIP_LOCAL_KEYTAB);
+                       localizedKeytabPath = 
flinkConfiguration.getString(YarnConfigOptions.LOCALIZED_KEYTAB_PATH);
+                       if (requireLocalizedKeytab) {
+                               // Localize the keytab to YARN containers via 
local resource.
+                               LOG.info("Adding keytab {} to the AM container 
local resource bucket", keytab);
+                               remotePathKeytab = setupSingleLocalResource(
+                                       localizedKeytabPath,
                                        fs,
                                        appId,
                                        new Path(keytab),
                                        localResources,
                                        homeDir,
                                        "",
                                        fileReplication);
+                       } else {
 
 Review comment:
   +1

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to