YARN-7082. TestContainerManagerSecurity failing in trunk. Contributed by Akira Ajisaka
(cherry picked from commit ebb34c7053
)
This commit is contained in:
parent
8947c0b881
commit
44f8b2a630
|
@ -112,9 +112,11 @@ public class BaseContainerTokenSecretManager extends
|
||||||
protected byte[] retrievePasswordInternal(ContainerTokenIdentifier identifier,
|
protected byte[] retrievePasswordInternal(ContainerTokenIdentifier identifier,
|
||||||
MasterKeyData masterKey)
|
MasterKeyData masterKey)
|
||||||
throws org.apache.hadoop.security.token.SecretManager.InvalidToken {
|
throws org.apache.hadoop.security.token.SecretManager.InvalidToken {
|
||||||
LOG.debug("Retrieving password for {} for user {} to be run on NM {}",
|
if (LOG.isDebugEnabled()) {
|
||||||
identifier.getContainerID(), identifier.getUser(),
|
LOG.debug("Retrieving password for {} for user {} to be run on NM {}",
|
||||||
identifier.getNmHostAddress());
|
identifier.getContainerID(), identifier.getUser(),
|
||||||
|
identifier.getNmHostAddress());
|
||||||
|
}
|
||||||
return createPassword(identifier.getBytes(), masterKey.getSecretKey());
|
return createPassword(identifier.getBytes(), masterKey.getSecretKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.hadoop.io.Text;
|
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.ContainerId;
|
||||||
import org.apache.hadoop.yarn.api.records.LogAggregationContext;
|
import org.apache.hadoop.yarn.api.records.LogAggregationContext;
|
||||||
import org.apache.hadoop.yarn.api.records.Priority;
|
import org.apache.hadoop.yarn.api.records.Priority;
|
||||||
|
@ -121,6 +122,12 @@ public class ContainerTokenIdentifierForTest extends ContainerTokenIdentifier {
|
||||||
return new ContainerIdPBImpl(proto.getContainerId());
|
return new ContainerIdPBImpl(proto.getContainerId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserGroupInformation getUser() {
|
||||||
|
final ContainerId containerId = getContainerID();
|
||||||
|
return UserGroupInformation.createRemoteUser(containerId.toString());
|
||||||
|
}
|
||||||
|
|
||||||
public String getApplicationSubmitter() {
|
public String getApplicationSubmitter() {
|
||||||
return proto.getAppSubmitter();
|
return proto.getAppSubmitter();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue