client: uses stream writer for deploy output
This fixes the image deploy output as we are now able to
correctly parse docker image push/pull output and display
the progress bars.
@@ -211,7 +211,8 @@ func (c *AppDeploy) Run(context *cmd.Context, client *cmd.Client) error {
return err
}
buf := safe.NewBuffer(nil)
- safeStdout := &safeWriter{w: context.Stdout}
+ stream := tsuruIo.NewStreamWriter(context.Stdout, nil)
+ safeStdout := &safeWriter{w: &tsuruIo.SimpleJsonMessageEncoderWriter{Encoder: json.NewEncoder(stream)}}
respBody := firstWriter{Writer: io.MultiWriter(safeStdout, buf)}
if c.image != "" {
request.Header.Set("Content-Type", "application/x-www-form-urlencoded")
