Fix progress reader output on close

Currently the progress reader won't close properly by not setting the close size.

fixes #11849

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: aa3083f577224ad74384f648b17c1474ab47b44f
Component: engine
This commit is contained in:
Derek McGowan
2015-03-31 13:17:25 -07:00
parent 471b420e47
commit 3b5106362e

View File

@ -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()
}