From d780e69559d8aa117e154a234d10f2112c32c8be Mon Sep 17 00:00:00 2001 From: Peter Hunt Date: Thu, 28 Feb 2019 13:29:56 -0500 Subject: 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 --- cmd/podman/exec.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cmd/podman') 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) } -- cgit v1.2.3-54-g00ecf