Make it explicit raw|multiplexed stream implementation being used

fix #35761

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof
2019-08-28 13:46:32 +02:00
parent 7c69b6dc08
commit af5d83a641
14 changed files with 151 additions and 28 deletions

View File

@@ -50,13 +50,14 @@ func (daemon *Daemon) ContainerAttach(prefixOrName string, c *backend.ContainerA
}
ctr.StreamConfig.AttachStreams(&cfg)
inStream, outStream, errStream, err := c.GetStreams()
multiplexed := !ctr.Config.Tty && c.MuxStreams
inStream, outStream, errStream, err := c.GetStreams(multiplexed)
if err != nil {
return err
}
defer inStream.Close()
if !ctr.Config.Tty && c.MuxStreams {
if multiplexed {
errStream = stdcopy.NewStdWriter(errStream, stdcopy.Stderr)
outStream = stdcopy.NewStdWriter(outStream, stdcopy.Stdout)
}