Merge pull request #16803 from tiborvass/pkg-broadcaster
Move types from progressreader and broadcastwriter to broadcaster Upstream-commit: bea2257f926ad8e49973d695254669c159987d19 Component: engine
This commit is contained in:
@@ -22,7 +22,7 @@ import (
|
||||
derr "github.com/docker/docker/errors"
|
||||
"github.com/docker/docker/image"
|
||||
"github.com/docker/docker/pkg/archive"
|
||||
"github.com/docker/docker/pkg/broadcastwriter"
|
||||
"github.com/docker/docker/pkg/broadcaster"
|
||||
"github.com/docker/docker/pkg/fileutils"
|
||||
"github.com/docker/docker/pkg/ioutils"
|
||||
"github.com/docker/docker/pkg/mount"
|
||||
@@ -41,8 +41,8 @@ var (
|
||||
)
|
||||
|
||||
type streamConfig struct {
|
||||
stdout *broadcastwriter.BroadcastWriter
|
||||
stderr *broadcastwriter.BroadcastWriter
|
||||
stdout *broadcaster.Unbuffered
|
||||
stderr *broadcaster.Unbuffered
|
||||
stdin io.ReadCloser
|
||||
stdinPipe io.WriteCloser
|
||||
}
|
||||
@@ -318,13 +318,13 @@ func (streamConfig *streamConfig) StdinPipe() io.WriteCloser {
|
||||
|
||||
func (streamConfig *streamConfig) StdoutPipe() io.ReadCloser {
|
||||
reader, writer := io.Pipe()
|
||||
streamConfig.stdout.AddWriter(writer)
|
||||
streamConfig.stdout.Add(writer)
|
||||
return ioutils.NewBufReader(reader)
|
||||
}
|
||||
|
||||
func (streamConfig *streamConfig) StderrPipe() io.ReadCloser {
|
||||
reader, writer := io.Pipe()
|
||||
streamConfig.stderr.AddWriter(writer)
|
||||
streamConfig.stderr.Add(writer)
|
||||
return ioutils.NewBufReader(reader)
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import (
|
||||
"github.com/docker/docker/graph"
|
||||
"github.com/docker/docker/image"
|
||||
"github.com/docker/docker/pkg/archive"
|
||||
"github.com/docker/docker/pkg/broadcastwriter"
|
||||
"github.com/docker/docker/pkg/broadcaster"
|
||||
"github.com/docker/docker/pkg/discovery"
|
||||
"github.com/docker/docker/pkg/fileutils"
|
||||
"github.com/docker/docker/pkg/graphdb"
|
||||
@@ -194,8 +194,8 @@ func (daemon *Daemon) Register(container *Container) error {
|
||||
container.daemon = daemon
|
||||
|
||||
// Attach to stdout and stderr
|
||||
container.stderr = broadcastwriter.New()
|
||||
container.stdout = broadcastwriter.New()
|
||||
container.stderr = new(broadcaster.Unbuffered)
|
||||
container.stdout = new(broadcaster.Unbuffered)
|
||||
// Attach to stdin
|
||||
if container.Config.OpenStdin {
|
||||
container.stdin, container.stdinPipe = io.Pipe()
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/docker/docker/daemon/execdriver"
|
||||
derr "github.com/docker/docker/errors"
|
||||
"github.com/docker/docker/pkg/broadcastwriter"
|
||||
"github.com/docker/docker/pkg/broadcaster"
|
||||
"github.com/docker/docker/pkg/ioutils"
|
||||
"github.com/docker/docker/pkg/pools"
|
||||
"github.com/docker/docker/pkg/stringid"
|
||||
@@ -233,8 +233,8 @@ func (d *Daemon) ContainerExecStart(name string, stdin io.ReadCloser, stdout io.
|
||||
cStderr = stderr
|
||||
}
|
||||
|
||||
ec.streamConfig.stderr = broadcastwriter.New()
|
||||
ec.streamConfig.stdout = broadcastwriter.New()
|
||||
ec.streamConfig.stderr = new(broadcaster.Unbuffered)
|
||||
ec.streamConfig.stdout = new(broadcaster.Unbuffered)
|
||||
// Attach to stdin
|
||||
if ec.OpenStdin {
|
||||
ec.streamConfig.stdin, ec.streamConfig.stdinPipe = io.Pipe()
|
||||
|
||||
Reference in New Issue
Block a user