Merge pull request #11961 from dmcgowan/fix-build-progress-output-11849

Fix progress reader output on close
Upstream-commit: da6248751b4e5300fe02e0b02bd4a664ba348044
Component: engine
This commit is contained in:
Michael Crosby
2015-03-31 14:04:33 -07:00
@@ -1,9 +1,10 @@
package progressreader
import (
"io"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/streamformatter"
"io"
)
// Reader with progress bar
@@ -43,6 +44,7 @@ func (config *Config) Read(p []byte) (n int, err error) {
return read, err
}
func (config *Config) Close() error {
config.Current = config.Size
config.Out.Write(config.Formatter.FormatProgress(config.ID, config.Action, &jsonmessage.JSONProgress{Current: config.Current, Total: config.Size}))
return config.In.Close()
}