Skip to content

Commit

Permalink
[FLINK-5949] [yarn] Don't check Kerberos credentials for non-Kerberos…
Browse files Browse the repository at this point in the history
… authentication methods

This closes apache#3528.
  • Loading branch information
tzulitai committed Mar 14, 2017
1 parent dabeb74 commit 87779ad
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,12 @@ public YarnClusterClient deploy() {
// for logins based on a keytab (fixed in Hadoop 2.6.1, see HADOOP-10786),
// so we check only in ticket cache scenario.
boolean useTicketCache = flinkConfiguration.getBoolean(SecurityOptions.KERBEROS_LOGIN_USETICKETCACHE);

UserGroupInformation loginUser = UserGroupInformation.getCurrentUser();
if (useTicketCache && !loginUser.hasKerberosCredentials()) {
LOG.error("Hadoop security is enabled but the login user does not have Kerberos credentials");
throw new RuntimeException("Hadoop security is enabled but the login user " +
if (loginUser.getAuthenticationMethod() == UserGroupInformation.AuthenticationMethod.KERBEROS
&& useTicketCache && !loginUser.hasKerberosCredentials()) {
LOG.error("Hadoop security with Kerberos is enabled but the login user does not have Kerberos credentials");
throw new RuntimeException("Hadoop security with Kerberos is enabled but the login user " +
"does not have Kerberos credentials");
}
}
Expand Down

0 comments on commit 87779ad

Please sign in to comment.