Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-05-25 14:58:31 -0400
committerJeff Johnston2018-05-25 19:15:01 -0400
commit6f52ee5d4d43afd0f242b004f4524d21ee941e47 (patch)
tree4cab208677f4efac3dd91f26441daadf75bf1195
parentd59658907f6d83ae420840db78c1bddc90ce4e28 (diff)
downloadorg.eclipse.linuxtools-6f52ee5d4d43afd0f242b004f4524d21ee941e47.tar.gz
org.eclipse.linuxtools-6f52ee5d4d43afd0f242b004f4524d21ee941e47.tar.xz
org.eclipse.linuxtools-6f52ee5d4d43afd0f242b004f4524d21ee941e47.zip
Revert change to use attachContainerOutput
- previous change causes regression to CDT Container build - previous change requires Container to be running at time of attach but we can't guarantee that the Container hasn't already finished in which case we get an exception or possibly miss output - instead key off the requirement of stdin; if specified, assume command is interactive and use attachContainerOutput, otherwise use attachLogs so the command can already be finished Change-Id: I5a7d7d48c456d4dabea7b6dc591708fcf1ab676f Reviewed-on: https://git.eclipse.org/r/123368 Tested-by: CI Bot Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/ContainerCommandProcess.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/ContainerCommandProcess.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/ContainerCommandProcess.java
index f88a0a70d0..ab10415cfe 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/ContainerCommandProcess.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/ContainerCommandProcess.java
@@ -124,9 +124,12 @@ public class ContainerCommandProcess extends Process {
state = connection.getContainerInfo(containerId).state();
if (state.running()) {
((DockerConnection) connection).attachCommand(inputToken, containerId, pipedStdinIn, null);
+ ((DockerConnection) connection).attachContainerOutput(token, containerId, pipedStdout,
+ pipedStderr);
}
+ } else {
+ ((DockerConnection) connection).attachLog(token, containerId, pipedStdout, pipedStderr);
}
- ((DockerConnection) connection).attachContainerOutput(token, containerId, pipedStdout, pipedStderr);
pipedStdout.flush();
pipedStderr.flush();
} catch (DockerException | InterruptedException | IOException e) {

Back to the top