diff --git a/engine/streams.go b/engine/streams.go index 4b1f172b49..07db058b2d 100644 --- a/engine/streams.go +++ b/engine/streams.go @@ -109,6 +109,18 @@ func (o *Output) Write(p []byte) (n int, err error) { return len(p), firstErr } +func (o *Output) Flush() { + o.Mutex.Lock() + defer o.Mutex.Unlock() + for _, dst := range o.dests { + if f, ok := dst.(interface { + Flush() + }); ok { + f.Flush() + } + } +} + // Close unregisters all destinations and waits for all background // AddTail and AddString tasks to complete. // The Close method of each destination is called if it exists. diff --git a/server.go b/server.go index e672f6a69a..3e4daad77f 100644 --- a/server.go +++ b/server.go @@ -1324,7 +1324,7 @@ func (srv *Server) ImagePull(job *engine.Job) engine.Status { tag string sf = utils.NewStreamFormatter(job.GetenvBool("json")) out = utils.NewWriteFlusher(job.Stdout) - authConfig *auth.AuthConfig + authConfig = &auth.AuthConfig{} metaHeaders map[string][]string ) if len(job.Args) > 1 {