hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jl...@apache.org
Subject hadoop git commit: YARN-7082. TestContainerManagerSecurity failing in trunk. Contributed by Akira Ajisaka
Date Wed, 11 Oct 2017 15:32:04 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk dc63a6a52 -> ebb34c705


YARN-7082. TestContainerManagerSecurity failing in trunk. Contributed by Akira Ajisaka


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

Branch: refs/heads/trunk
Commit: ebb34c7053ee93296412591f83a776846765fda5
Parents: dc63a6a
Author: Jason Lowe <jlowe@apache.org>
Authored: Wed Oct 11 10:31:02 2017 -0500
Committer: Jason Lowe <jlowe@apache.org>
Committed: Wed Oct 11 10:31:02 2017 -0500

----------------------------------------------------------------------
 .../server/security/BaseContainerTokenSecretManager.java     | 8 +++++---
 .../hadoop/yarn/server/ContainerTokenIdentifierForTest.java  | 7 +++++++
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/ebb34c70/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/security/BaseContainerTokenSecretManager.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/security/BaseContainerTokenSecretManager.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/security/BaseContainerTokenSecretManager.java
index a5590fb..420c899 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/security/BaseContainerTokenSecretManager.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/security/BaseContainerTokenSecretManager.java
@@ -112,9 +112,11 @@ public class BaseContainerTokenSecretManager extends
   protected byte[] retrievePasswordInternal(ContainerTokenIdentifier identifier,
       MasterKeyData masterKey)
       throws org.apache.hadoop.security.token.SecretManager.InvalidToken {
-    LOG.debug("Retrieving password for {} for user {} to be run on NM {}",
-        identifier.getContainerID(), identifier.getUser(),
-        identifier.getNmHostAddress());
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("Retrieving password for {} for user {} to be run on NM {}",
+          identifier.getContainerID(), identifier.getUser(),
+          identifier.getNmHostAddress());
+    }
     return createPassword(identifier.getBytes(), masterKey.getSecretKey());
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/ebb34c70/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/ContainerTokenIdentifierForTest.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/ContainerTokenIdentifierForTest.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/ContainerTokenIdentifierForTest.java
index 0d4d2e2..068b140 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/ContainerTokenIdentifierForTest.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/ContainerTokenIdentifierForTest.java
@@ -24,6 +24,7 @@ import java.io.IOException;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.hadoop.io.Text;
+import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.yarn.api.records.ContainerId;
 import org.apache.hadoop.yarn.api.records.LogAggregationContext;
 import org.apache.hadoop.yarn.api.records.Priority;
@@ -121,6 +122,12 @@ public class ContainerTokenIdentifierForTest extends ContainerTokenIdentifier
{
     return new ContainerIdPBImpl(proto.getContainerId());
   }
 
+  @Override
+  public UserGroupInformation getUser() {
+    final ContainerId containerId = getContainerID();
+    return UserGroupInformation.createRemoteUser(containerId.toString());
+  }
+
   public String getApplicationSubmitter() {
     return proto.getAppSubmitter();
   }


---------------------------------------------------------------------
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