From 7526815e3234ca352854ecfb142a13f1a188d5bd Mon Sep 17 00:00:00 2001 From: Jason Lowe Date: Thu, 2 Aug 2018 10:43:48 -0500 Subject: [PATCH] YARN-8263. DockerClient still touches hadoop.tmp.dir. Contributed by Craig Condit --- .../nodemanager/LinuxContainerExecutor.java | 6 +-- .../runtime/DockerLinuxContainerRuntime.java | 17 +++--- .../linux/runtime/docker/DockerClient.java | 53 ------------------- .../linux/runtime/docker/DockerCommand.java | 6 +-- .../runtime/docker/DockerCommandExecutor.java | 15 ++---- .../runtime/docker/DockerInspectCommand.java | 3 +- .../linux/runtime/docker/DockerRmCommand.java | 3 +- .../runtime/docker/TestDockerClient.java | 2 +- .../docker/TestDockerCommandExecutor.java | 20 +++---- 9 files changed, 30 insertions(+), 95 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java index 4253f2f0d5..f75ead2e0d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java @@ -944,12 +944,12 @@ public void removeDockerContainer(String containerId) { PrivilegedOperationExecutor privOpExecutor = PrivilegedOperationExecutor.getInstance(super.getConf()); if (DockerCommandExecutor.isRemovable( - DockerCommandExecutor.getContainerStatus(containerId, - super.getConf(), privOpExecutor, nmContext))) { + DockerCommandExecutor.getContainerStatus(containerId, privOpExecutor, + nmContext))) { LOG.info("Removing Docker container : " + containerId); DockerRmCommand dockerRmCommand = new DockerRmCommand(containerId); DockerCommandExecutor.executeDockerCommand(dockerRmCommand, containerId, - null, super.getConf(), privOpExecutor, false, nmContext); + null, privOpExecutor, false, nmContext); } } catch (ContainerExecutionException e) { LOG.warn("Unable to remove docker container: " + containerId); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java index 88e6c91dac..5d6f61e612 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/DockerLinuxContainerRuntime.java @@ -298,7 +298,7 @@ public void initialize(Configuration conf, Context nmContext) throws ContainerExecutionException { this.nmContext = nmContext; this.conf = conf; - dockerClient = new DockerClient(conf); + dockerClient = new DockerClient(); allowedNetworks.clear(); defaultROMounts.clear(); defaultRWMounts.clear(); @@ -973,7 +973,7 @@ public void relaunchContainer(ContainerRuntimeContext ctx) String containerIdStr = containerId.toString(); // Check to see if the container already exists for relaunch DockerCommandExecutor.DockerContainerStatus containerStatus = - DockerCommandExecutor.getContainerStatus(containerIdStr, conf, + DockerCommandExecutor.getContainerStatus(containerIdStr, privilegedOperationExecutor, nmContext); if (containerStatus != null && DockerCommandExecutor.isStartable(containerStatus)) { @@ -1219,13 +1219,13 @@ private void executeLivelinessCheck(ContainerRuntimeContext ctx) private void handleContainerStop(String containerId, Map env) throws ContainerExecutionException { DockerCommandExecutor.DockerContainerStatus containerStatus = - DockerCommandExecutor.getContainerStatus(containerId, conf, + DockerCommandExecutor.getContainerStatus(containerId, privilegedOperationExecutor, nmContext); if (DockerCommandExecutor.isStoppable(containerStatus)) { DockerStopCommand dockerStopCommand = new DockerStopCommand( containerId).setGracePeriod(dockerStopGracePeriod); DockerCommandExecutor.executeDockerCommand(dockerStopCommand, containerId, - env, conf, privilegedOperationExecutor, false, nmContext); + env, privilegedOperationExecutor, false, nmContext); } else { if (LOG.isDebugEnabled()) { LOG.debug( @@ -1247,14 +1247,13 @@ private void handleContainerKill(ContainerRuntimeContext ctx, if (isContainerRequestedAsPrivileged(container)) { String containerId = container.getContainerId().toString(); DockerCommandExecutor.DockerContainerStatus containerStatus = - DockerCommandExecutor.getContainerStatus(containerId, conf, + DockerCommandExecutor.getContainerStatus(containerId, privilegedOperationExecutor, nmContext); if (DockerCommandExecutor.isKillable(containerStatus)) { DockerKillCommand dockerKillCommand = new DockerKillCommand(containerId).setSignal(signal.name()); DockerCommandExecutor.executeDockerCommand(dockerKillCommand, - containerId, env, conf, privilegedOperationExecutor, false, - nmContext); + containerId, env, privilegedOperationExecutor, false, nmContext); } else { LOG.debug( "Container status is {}, skipping kill - {}", @@ -1292,12 +1291,12 @@ private void handleContainerRemove(String containerId, + containerId); } else { DockerCommandExecutor.DockerContainerStatus containerStatus = - DockerCommandExecutor.getContainerStatus(containerId, conf, + DockerCommandExecutor.getContainerStatus(containerId, privilegedOperationExecutor, nmContext); if (DockerCommandExecutor.isRemovable(containerStatus)) { DockerRmCommand dockerRmCommand = new DockerRmCommand(containerId); DockerCommandExecutor.executeDockerCommand(dockerRmCommand, containerId, - env, conf, privilegedOperationExecutor, false, nmContext); + env, privilegedOperationExecutor, false, nmContext); } } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerClient.java index fca707ce31..3a516c46ef 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerClient.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerClient.java @@ -22,7 +22,6 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.yarn.api.records.ApplicationId; @@ -50,58 +49,6 @@ public final class DockerClient { private static final String TMP_FILE_PREFIX = "docker."; private static final String TMP_FILE_SUFFIX = ".cmd"; private static final String TMP_ENV_FILE_SUFFIX = ".env"; - private final String tmpDirPath; - - public DockerClient(Configuration conf) throws ContainerExecutionException { - - String tmpDirBase = conf.get("hadoop.tmp.dir"); - if (tmpDirBase == null) { - throw new ContainerExecutionException("hadoop.tmp.dir not set!"); - } - tmpDirPath = tmpDirBase + "/nm-docker-cmds"; - - File tmpDir = new File(tmpDirPath); - if (!(tmpDir.exists() || tmpDir.mkdirs())) { - LOG.warn("Unable to create directory: " + tmpDirPath); - throw new ContainerExecutionException("Unable to create directory: " + - tmpDirPath); - } - } - - public String writeCommandToTempFile(DockerCommand cmd, String filePrefix) - throws ContainerExecutionException { - try { - File dockerCommandFile = File.createTempFile(TMP_FILE_PREFIX + filePrefix, - TMP_FILE_SUFFIX, new - File(tmpDirPath)); - try ( - Writer writer = new OutputStreamWriter( - new FileOutputStream(dockerCommandFile), "UTF-8"); - PrintWriter printWriter = new PrintWriter(writer); - ) { - printWriter.println("[docker-command-execution]"); - for (Map.Entry> entry : - cmd.getDockerCommandWithArguments().entrySet()) { - if (entry.getKey().contains("=")) { - throw new ContainerExecutionException( - "'=' found in entry for docker command file, key = " + entry - .getKey() + "; value = " + entry.getValue()); - } - if (entry.getValue().contains("\n")) { - throw new ContainerExecutionException( - "'\\n' found in entry for docker command file, key = " + entry - .getKey() + "; value = " + entry.getValue()); - } - printWriter.println(" " + entry.getKey() + "=" + StringUtils - .join(",", entry.getValue())); - } - return dockerCommandFile.getAbsolutePath(); - } - } catch (IOException e) { - LOG.warn("Unable to write docker command to temporary file!"); - throw new ContainerExecutionException(e); - } - } private String writeEnvFile(DockerRunCommand cmd, String filePrefix, File cmdDir) throws IOException { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerCommand.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerCommand.java index 366457d11e..260c5b53f5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerCommand.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerCommand.java @@ -22,7 +22,6 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.server.nodemanager.Context; @@ -117,16 +116,15 @@ public void setClientConfigDir(String clientConfigDir) { * @param dockerCommand Specific command to be run by docker. * @param containerName * @param env - * @param conf * @param nmContext * @return Returns the PrivilegedOperation object to be used. * @throws ContainerExecutionException */ public PrivilegedOperation preparePrivilegedOperation( DockerCommand dockerCommand, String containerName, Map env, Configuration conf, Context nmContext) + String> env, Context nmContext) throws ContainerExecutionException { - DockerClient dockerClient = new DockerClient(conf); + DockerClient dockerClient = new DockerClient(); String commandFile = dockerClient.writeCommandToTempFile(dockerCommand, ContainerId.fromString(containerName), diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerCommandExecutor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerCommandExecutor.java index 8a4888cb2c..7b6497cd18 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerCommandExecutor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerCommandExecutor.java @@ -16,7 +16,6 @@ */ package org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.docker; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.yarn.server.nodemanager.Context; import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperation; import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationException; @@ -68,19 +67,18 @@ private DockerCommandExecutor() { * @param dockerCommand the docker command to run. * @param containerId the id of the container. * @param env environment for the container. - * @param conf the hadoop configuration. * @param privilegedOperationExecutor the privileged operations executor. * @param disableFailureLogging disable logging for known rc failures. * @return the output of the operation. * @throws ContainerExecutionException if the operation fails. */ public static String executeDockerCommand(DockerCommand dockerCommand, - String containerId, Map env, Configuration conf, + String containerId, Map env, PrivilegedOperationExecutor privilegedOperationExecutor, boolean disableFailureLogging, Context nmContext) throws ContainerExecutionException { PrivilegedOperation dockerOp = dockerCommand.preparePrivilegedOperation( - dockerCommand, containerId, env, conf, nmContext); + dockerCommand, containerId, env, nmContext); if (disableFailureLogging) { dockerOp.disableFailureLogging(); @@ -108,18 +106,16 @@ public static String executeDockerCommand(DockerCommand dockerCommand, * an exception and the nonexistent status is returned. * * @param containerId the id of the container. - * @param conf the hadoop configuration. * @param privilegedOperationExecutor the privileged operations executor. * @return a {@link DockerContainerStatus} representing the current status. */ public static DockerContainerStatus getContainerStatus(String containerId, - Configuration conf, PrivilegedOperationExecutor privilegedOperationExecutor, Context nmContext) { try { DockerContainerStatus dockerContainerStatus; String currentContainerStatus = - executeStatusCommand(containerId, conf, + executeStatusCommand(containerId, privilegedOperationExecutor, nmContext); if (currentContainerStatus == null) { dockerContainerStatus = DockerContainerStatus.UNKNOWN; @@ -170,13 +166,11 @@ public static DockerContainerStatus getContainerStatus(String containerId, * status. * * @param containerId the id of the container. - * @param conf the hadoop configuration. * @param privilegedOperationExecutor the privileged operations executor. * @return the current container status. * @throws ContainerExecutionException if the docker operation fails to run. */ private static String executeStatusCommand(String containerId, - Configuration conf, PrivilegedOperationExecutor privilegedOperationExecutor, Context nmContext) throws ContainerExecutionException { @@ -184,8 +178,7 @@ private static String executeStatusCommand(String containerId, new DockerInspectCommand(containerId).getContainerStatus(); try { return DockerCommandExecutor.executeDockerCommand(dockerInspectCommand, - containerId, null, conf, privilegedOperationExecutor, true, - nmContext); + containerId, null, privilegedOperationExecutor, true, nmContext); } catch (ContainerExecutionException e) { throw new ContainerExecutionException(e); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerInspectCommand.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerInspectCommand.java index 3ed9c18524..e9461610e0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerInspectCommand.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerInspectCommand.java @@ -20,7 +20,6 @@ package org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.docker; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.yarn.server.nodemanager.Context; import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperation; @@ -58,7 +57,7 @@ public DockerInspectCommand getIpAndHost() { @Override public PrivilegedOperation preparePrivilegedOperation( DockerCommand dockerCommand, String containerName, Map env, Configuration conf, Context nmContext) { + String> env, Context nmContext) { PrivilegedOperation dockerOp = new PrivilegedOperation( PrivilegedOperation.OperationType.INSPECT_DOCKER_CONTAINER); dockerOp.appendArgs(commandArguments, containerName); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerRmCommand.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerRmCommand.java index 3a02982d0d..490cf9eeed 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerRmCommand.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerRmCommand.java @@ -16,7 +16,6 @@ */ package org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.docker; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.yarn.server.nodemanager.Context; import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperation; @@ -37,7 +36,7 @@ public DockerRmCommand(String containerName) { @Override public PrivilegedOperation preparePrivilegedOperation( DockerCommand dockerCommand, String containerName, Map env, Configuration conf, Context nmContext) { + String> env, Context nmContext) { PrivilegedOperation dockerOp = new PrivilegedOperation( PrivilegedOperation.OperationType.REMOVE_DOCKER_CONTAINER); dockerOp.appendArgs(containerName); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerClient.java index efd7db5f1c..31645bcde4 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerClient.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerClient.java @@ -68,7 +68,7 @@ public void testWriteCommandToTempFile() throws Exception { doReturn(conf).when(mockContext).getConf(); doReturn(dirsHandler).when(mockContext).getLocalDirsHandler(); - DockerClient dockerClient = new DockerClient(conf); + DockerClient dockerClient = new DockerClient(); dirsHandler.init(conf); dirsHandler.start(); String tmpPath = dockerClient.writeCommandToTempFile(dockerCmd, cid, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerCommandExecutor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerCommandExecutor.java index 50d00bb518..46415c1fdd 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerCommandExecutor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerCommandExecutor.java @@ -138,7 +138,7 @@ public void testExecuteDockerCommand() throws Exception { DockerStopCommand dockerStopCommand = new DockerStopCommand(MOCK_CONTAINER_ID); DockerCommandExecutor.executeDockerCommand(dockerStopCommand, - cId.toString(), env, configuration, mockExecutor, false, nmContext); + cId.toString(), env, mockExecutor, false, nmContext); List ops = MockPrivilegedOperationCaptor .capturePrivilegedOperations(mockExecutor, 1, true); assertEquals(1, ops.size()); @@ -150,7 +150,7 @@ public void testExecuteDockerCommand() throws Exception { public void testExecuteDockerRm() throws Exception { DockerRmCommand dockerCommand = new DockerRmCommand(MOCK_CONTAINER_ID); DockerCommandExecutor.executeDockerCommand(dockerCommand, MOCK_CONTAINER_ID, - env, configuration, mockExecutor, false, nmContext); + env, mockExecutor, false, nmContext); List ops = MockPrivilegedOperationCaptor .capturePrivilegedOperations(mockExecutor, 1, true); PrivilegedOperation privOp = ops.get(0); @@ -167,7 +167,7 @@ public void testExecuteDockerRm() throws Exception { public void testExecuteDockerStop() throws Exception { DockerStopCommand dockerCommand = new DockerStopCommand(MOCK_CONTAINER_ID); DockerCommandExecutor.executeDockerCommand(dockerCommand, MOCK_CONTAINER_ID, - env, configuration, mockExecutor, false, nmContext); + env, mockExecutor, false, nmContext); List ops = MockPrivilegedOperationCaptor .capturePrivilegedOperations(mockExecutor, 1, true); List dockerCommands = getValidatedDockerCommands(ops); @@ -185,7 +185,7 @@ public void testExecuteDockerInspectStatus() throws Exception { DockerInspectCommand dockerCommand = new DockerInspectCommand(MOCK_CONTAINER_ID).getContainerStatus(); DockerCommandExecutor.executeDockerCommand(dockerCommand, MOCK_CONTAINER_ID, - env, configuration, mockExecutor, false, nmContext); + env, mockExecutor, false, nmContext); List ops = MockPrivilegedOperationCaptor .capturePrivilegedOperations(mockExecutor, 1, true); PrivilegedOperation privOp = ops.get(0); @@ -204,7 +204,7 @@ public void testExecuteDockerPull() throws Exception { DockerPullCommand dockerCommand = new DockerPullCommand(MOCK_IMAGE_NAME); DockerCommandExecutor.executeDockerCommand(dockerCommand, MOCK_CONTAINER_ID, - env, configuration, mockExecutor, false, nmContext); + env, mockExecutor, false, nmContext); List ops = MockPrivilegedOperationCaptor .capturePrivilegedOperations(mockExecutor, 1, true); List dockerCommands = getValidatedDockerCommands(ops); @@ -222,7 +222,7 @@ public void testExecuteDockerLoad() throws Exception { DockerLoadCommand dockerCommand = new DockerLoadCommand(MOCK_LOCAL_IMAGE_NAME); DockerCommandExecutor.executeDockerCommand(dockerCommand, MOCK_CONTAINER_ID, - env, configuration, mockExecutor, false, nmContext); + env, mockExecutor, false, nmContext); List ops = MockPrivilegedOperationCaptor .capturePrivilegedOperations(mockExecutor, 1, true); List dockerCommands = getValidatedDockerCommands(ops); @@ -244,7 +244,7 @@ public void testGetContainerStatus() throws Exception { any(PrivilegedOperation.class), eq(null), any(), eq(true), eq(false))) .thenReturn(status.getName()); assertEquals(status, DockerCommandExecutor.getContainerStatus( - MOCK_CONTAINER_ID, configuration, mockExecutor, nmContext)); + MOCK_CONTAINER_ID, mockExecutor, nmContext)); } } @@ -254,7 +254,7 @@ public void testExecuteDockerKillSIGQUIT() throws Exception { new DockerKillCommand(MOCK_CONTAINER_ID) .setSignal(ContainerExecutor.Signal.QUIT.name()); DockerCommandExecutor.executeDockerCommand(dockerKillCommand, - MOCK_CONTAINER_ID, env, configuration, mockExecutor, false, nmContext); + MOCK_CONTAINER_ID, env, mockExecutor, false, nmContext); List ops = MockPrivilegedOperationCaptor .capturePrivilegedOperations(mockExecutor, 1, true); List dockerCommands = getValidatedDockerCommands(ops); @@ -275,7 +275,7 @@ public void testExecuteDockerKillSIGKILL() throws Exception { new DockerKillCommand(MOCK_CONTAINER_ID) .setSignal(ContainerExecutor.Signal.KILL.name()); DockerCommandExecutor.executeDockerCommand(dockerKillCommand, - MOCK_CONTAINER_ID, env, configuration, mockExecutor, false, nmContext); + MOCK_CONTAINER_ID, env, mockExecutor, false, nmContext); List ops = MockPrivilegedOperationCaptor .capturePrivilegedOperations(mockExecutor, 1, true); List dockerCommands = getValidatedDockerCommands(ops); @@ -296,7 +296,7 @@ public void testExecuteDockerKillSIGTERM() throws Exception { new DockerKillCommand(MOCK_CONTAINER_ID) .setSignal(ContainerExecutor.Signal.TERM.name()); DockerCommandExecutor.executeDockerCommand(dockerKillCommand, - MOCK_CONTAINER_ID, env, configuration, mockExecutor, false, nmContext); + MOCK_CONTAINER_ID, env, mockExecutor, false, nmContext); List ops = MockPrivilegedOperationCaptor .capturePrivilegedOperations(mockExecutor, 1, true); List dockerCommands = getValidatedDockerCommands(ops);