summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPeter Hunt <pehunt@redhat.com>2019-02-28 13:29:56 -0500
committerPeter Hunt <pehunt@redhat.com>2019-02-28 14:55:11 -0500
commitd780e69559d8aa117e154a234d10f2112c32c8be (patch)
tree859558158bd18ba14da6962970e3e2108428bd07 /cmd
parent2e463b7720769d85dcdae516cad96c57e96b7464 (diff)
downloadpodman-d780e69559d8aa117e154a234d10f2112c32c8be.tar.gz
podman-d780e69559d8aa117e154a234d10f2112c32c8be.tar.bz2
podman-d780e69559d8aa117e154a234d10f2112c32c8be.zip
Allow Exec API user to override streams
Allow passing in of AttachStreams to libpod.Exec() for usage in podman healthcheck. An API caller can now specify different streams for stdout, stderr and stdin, or no streams at all. Signed-off-by: Peter Hunt <pehunt@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/exec.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/podman/exec.go b/cmd/podman/exec.go
index 032262497..4917fb606 100644
--- a/cmd/podman/exec.go
+++ b/cmd/podman/exec.go
@@ -105,5 +105,13 @@ func execCmd(c *cliconfig.ExecValues) error {
envs = append(envs, fmt.Sprintf("%s=%s", k, v))
}
- return ctr.Exec(c.Tty, c.Privileged, envs, cmd, c.User, c.Workdir)
+ streams := new(libpod.AttachStreams)
+ streams.OutputStream = os.Stdout
+ streams.ErrorStream = os.Stderr
+ streams.InputStream = os.Stdin
+ streams.AttachOutput = true
+ streams.AttachError = true
+ streams.AttachInput = true
+
+ return ctr.Exec(c.Tty, c.Privileged, envs, cmd, c.User, c.Workdir, streams)
}