summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorDaniel Nephin <dnephin@docker.com>2017-05-01 14:54:56 -0400
committerDaniel Nephin <dnephin@docker.com>2017-05-02 17:38:12 -0400
commitc87d67b0ad788a6a80d1af89488e2d1f22726c34 (patch)
tree95c9e71aa0f663d60d721c2866df60325b0aea56 /cli
parentfa54c94b9d70c0582012aaef18991e1fb4dd59ba (diff)
downloaddocker-c87d67b0ad788a6a80d1af89488e2d1f22726c34.tar.gz
Refacator pkg/streamformatter
StreamFormatter suffered was two distinct structs mixed into a single struct without any overlap. Signed-off-by: Daniel Nephin <dnephin@docker.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/command/image/build.go2
-rw-r--r--cli/command/image/build/context.go2
-rw-r--r--cli/command/service/progress/progress.go2
3 files changed, 3 insertions, 3 deletions
diff --git a/cli/command/image/build.go b/cli/command/image/build.go
index 27fe83c524..cdb116f169 100644
--- a/cli/command/image/build.go
+++ b/cli/command/image/build.go
@@ -269,7 +269,7 @@ func runBuild(dockerCli *command.DockerCli, options buildOptions) error {
}
// Setup an upload progress bar
- progressOutput := streamformatter.NewStreamFormatter().NewProgressOutput(progBuff, true)
+ progressOutput := streamformatter.NewProgressOutput(progBuff)
if !dockerCli.Out().IsTerminal() {
progressOutput = &lastProgressOutput{output: progressOutput}
}
diff --git a/cli/command/image/build/context.go b/cli/command/image/build/context.go
index 348c721931..5e66717a04 100644
--- a/cli/command/image/build/context.go
+++ b/cli/command/image/build/context.go
@@ -154,7 +154,7 @@ func GetContextFromURL(out io.Writer, remoteURL, dockerfileName string) (io.Read
if err != nil {
return nil, "", errors.Errorf("unable to download remote context %s: %v", remoteURL, err)
}
- progressOutput := streamformatter.NewStreamFormatter().NewProgressOutput(out, true)
+ progressOutput := streamformatter.NewProgressOutput(out)
// Pass the response body through a progress reader.
progReader := progress.NewProgressReader(response.Body, progressOutput, response.ContentLength, "", fmt.Sprintf("Downloading build context from remote url: %s", remoteURL))
diff --git a/cli/command/service/progress/progress.go b/cli/command/service/progress/progress.go
index bfeaa314a4..d68fc6c1af 100644
--- a/cli/command/service/progress/progress.go
+++ b/cli/command/service/progress/progress.go
@@ -62,7 +62,7 @@ func stateToProgress(state swarm.TaskState, rollback bool) int64 {
func ServiceProgress(ctx context.Context, client client.APIClient, serviceID string, progressWriter io.WriteCloser) error {
defer progressWriter.Close()
- progressOut := streamformatter.NewJSONStreamFormatter().NewProgressOutput(progressWriter, false)
+ progressOut := streamformatter.NewJSONProgressOutput(progressWriter, false)
sigint := make(chan os.Signal, 1)
signal.Notify(sigint, os.Interrupt)