hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject hadoop git commit: YARN-8879. Kerberos principal is needed when submitting a submarine job. Contributed by Zac Zhou.
Date Tue, 16 Oct 2018 16:48:39 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-3.2 7b0638316 -> a439aa79d


YARN-8879. Kerberos principal is needed when submitting a submarine job. Contributed by Zac
Zhou.

(cherry picked from commit 753f149fd3f5acf9a98cfc780d7899e307c19002)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/a439aa79
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/a439aa79
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/a439aa79

Branch: refs/heads/branch-3.2
Commit: a439aa79dc7b70325ce4f1e331ae3acfe78f6f3f
Parents: 7b06383
Author: Sunil G <sunilg@apache.org>
Authored: Tue Oct 16 22:17:51 2018 +0530
Committer: Sunil G <sunilg@apache.org>
Committed: Tue Oct 16 22:18:30 2018 +0530

----------------------------------------------------------------------
 .../org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java | 5 +----
 .../apache/hadoop/yarn/service/utils/TestServiceApiUtil.java | 8 ++++++++
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/a439aa79/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java
index d201c7d..f055981 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/utils/ServiceApiUtil.java
@@ -245,15 +245,12 @@ public class ServiceApiUtil {
 
   public static void validateKerberosPrincipal(
       KerberosPrincipal kerberosPrincipal) throws IOException {
-    try {
+    if (!StringUtils.isEmpty(kerberosPrincipal.getPrincipalName())) {
       if (!kerberosPrincipal.getPrincipalName().contains("/")) {
         throw new IllegalArgumentException(String.format(
             RestApiErrorMessages.ERROR_KERBEROS_PRINCIPAL_NAME_FORMAT,
             kerberosPrincipal.getPrincipalName()));
       }
-    } catch (NullPointerException e) {
-      throw new IllegalArgumentException(
-          RestApiErrorMessages.ERROR_KERBEROS_PRINCIPAL_MISSING);
     }
     if (!StringUtils.isEmpty(kerberosPrincipal.getKeytab())) {
       try {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a439aa79/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/utils/TestServiceApiUtil.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/utils/TestServiceApiUtil.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/utils/TestServiceApiUtil.java
index 1e3c180..4940f8b 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/utils/TestServiceApiUtil.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/test/java/org/apache/hadoop/yarn/service/utils/TestServiceApiUtil.java
@@ -652,6 +652,14 @@ public class TestServiceApiUtil extends ServiceTestUtils {
     } catch (IllegalArgumentException e) {
       Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage());
     }
+
+    kp.setPrincipalName(null);
+    kp.setKeytab(null);
+    try {
+      ServiceApiUtil.validateKerberosPrincipal(app.getKerberosPrincipal());
+    } catch (NullPointerException e) {
+        Assert.fail(NO_EXCEPTION_PREFIX + e.getMessage());
+    }
   }
 
   @Test


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message