summaryrefslogtreecommitdiff
path: root/pkg/adapter
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-20 13:49:08 +0200
committerGitHub <noreply@github.com>2019-10-20 13:49:08 +0200
commitd3520de6338dd1bce2dd1d51847e064e5299f63e (patch)
tree3973ed04ac2b7a1ab7be6dd83f6d0d0228781697 /pkg/adapter
parent02ab9c73c1ec48820db6aed9a0cb5c4d46ea0752 (diff)
parent867d49957bb1160f2bed740e715a0f6b2cf16a17 (diff)
downloadpodman-d3520de6338dd1bce2dd1d51847e064e5299f63e.tar.gz
podman-d3520de6338dd1bce2dd1d51847e064e5299f63e.tar.bz2
podman-d3520de6338dd1bce2dd1d51847e064e5299f63e.zip
Merge pull request #4125 from baude/remotestdin
Add ability to redirect bash for run -i
Diffstat (limited to 'pkg/adapter')
-rw-r--r--pkg/adapter/containers_remote.go9
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