From 1df4dba0a0c335ad68b1c2202b8099cd87aa3d94 Mon Sep 17 00:00:00 2001 From: Peter Hunt Date: Thu, 31 Oct 2019 10:41:26 -0400 Subject: Switch to bufio Reader for exec streams There were many situations that made exec act funky with input. pipes didn't work as expected, as well as sending input before the shell opened. Thinking about it, it seemed as though the issues were because of how os.Stdin buffers (it doesn't). Dropping this input had some weird consequences. Instead, read from os.Stdin as bufio.Reader, allowing the input to buffer before passing it to the container. Signed-off-by: Peter Hunt --- libpod/healthcheck.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libpod/healthcheck.go') diff --git a/libpod/healthcheck.go b/libpod/healthcheck.go index 68ffc2349..e9c950713 100644 --- a/libpod/healthcheck.go +++ b/libpod/healthcheck.go @@ -133,7 +133,9 @@ func (c *Container) runHealthCheck() (HealthCheckStatus, error) { streams := new(AttachStreams) streams.OutputStream = hcw streams.ErrorStream = hcw - streams.InputStream = os.Stdin + + streams.InputStream = bufio.NewReader(os.Stdin) + streams.AttachOutput = true streams.AttachError = true streams.AttachInput = true -- cgit v1.2.3-54-g00ecf