diff options
author | baude <bbaude@redhat.com> | 2019-09-26 15:41:46 -0500 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-10-15 08:00:13 -0500 |
commit | 867d49957bb1160f2bed740e715a0f6b2cf16a17 (patch) | |
tree | 5ad7c2e2d4e32b5edf753b63944350f5a7178514 /pkg/adapter/containers_remote.go | |
parent | e5de079714a72746c8bdc67bb9fc2f522edfefe1 (diff) | |
download | podman-867d49957bb1160f2bed740e715a0f6b2cf16a17.tar.gz podman-867d49957bb1160f2bed740e715a0f6b2cf16a17.tar.bz2 podman-867d49957bb1160f2bed740e715a0f6b2cf16a17.zip |
Add ability to redirect bash for run -i
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/adapter/containers_remote.go')
-rw-r--r-- | pkg/adapter/containers_remote.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/adapter/containers_remote.go b/pkg/adapter/containers_remote.go index f7cb28b0c..f4e83a975 100644 --- a/pkg/adapter/containers_remote.go +++ b/pkg/adapter/containers_remote.go @@ -1092,6 +1092,7 @@ func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, std // These are the special writers that encode input from the client. varlinkStdinWriter := virtwriter.NewVirtWriteCloser(writer, virtwriter.ToStdin) varlinkResizeWriter := virtwriter.NewVirtWriteCloser(writer, virtwriter.TerminalResize) + varlinkHangupWriter := virtwriter.NewVirtWriteCloser(writer, virtwriter.HangUpFromClient) go func() { // Read from the wire and direct to stdout or stderr @@ -1117,7 +1118,6 @@ func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, std } } }() - if stdin != nil { // Takes stdinput and sends it over the wire after being encoded go func() { @@ -1126,7 +1126,12 @@ func configureVarlinkAttachStdio(reader *bufio.Reader, writer *bufio.Writer, std sendGenericError(ecChan) errChan <- err } - + _, err := varlinkHangupWriter.Write([]byte("EOF")) + if err != nil { + logrus.Errorf("unable to notify server to hangup: %q", err) + } + err = varlinkStdinWriter.Close() + errChan <- err }() } return errChan |