summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-09 14:01:42 +0100
committerGitHub <noreply@github.com>2020-01-09 14:01:42 +0100
commit154b5ca85dc760e047f3f91a1a0a4fb64e918b2c (patch)
treeedbc9053ee275fd03d8cc516ec0502d6bc864fd8
parentfe49aa0f5058efb2a37af744d20b27ce071f8073 (diff)
parent776eb64ab2cc07e0bd2879791780fa9b9fcd7ea1 (diff)
downloadpodman-154b5ca85dc760e047f3f91a1a0a4fb64e918b2c.tar.gz
podman-154b5ca85dc760e047f3f91a1a0a4fb64e918b2c.tar.bz2
podman-154b5ca85dc760e047f3f91a1a0a4fb64e918b2c.zip
Merge pull request #4818 from haircommander/piped-exec-fix
exec: fix pipes
-rw-r--r--libpod/oci_conmon_linux.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go
index 0312f0ba2..b09dc3a4f 100644
--- a/libpod/oci_conmon_linux.go
+++ b/libpod/oci_conmon_linux.go
@@ -546,6 +546,10 @@ func (r *ConmonOCIRuntime) ExecContainer(c *Container, sessionID string, options
args = append(args, "-t")
}
+ if options.Streams.AttachInput {
+ args = append(args, "-i")
+ }
+
// Append container ID and command
args = append(args, "-e")
// TODO make this optional when we can detach
@@ -558,9 +562,8 @@ func (r *ConmonOCIRuntime) ExecContainer(c *Container, sessionID string, options
execCmd := exec.Command(r.conmonPath, args...)
if options.Streams != nil {
- if options.Streams.AttachInput {
- execCmd.Stdin = options.Streams.InputStream
- }
+ // Don't add the InputStream to the execCmd. Instead, the data should be passed
+ // through CopyDetachable
if options.Streams.AttachOutput {
execCmd.Stdout = options.Streams.OutputStream
}