From 8f8fd1d900303f2f2fe562357c96d0855ff77a5c Mon Sep 17 00:00:00 2001 From: umohnani8 Date: Mon, 19 Feb 2018 15:39:56 -0500 Subject: Fix podman save when redirecting output podman save would write the progress bar to the image tar file when the output was redirected with >. Fixed the writer to write to stderr for all commands using writer Signed-off-by: umohnani8 Closes: #362 Approved by: mheon --- cmd/podman/create.go | 2 +- cmd/podman/load.go | 2 +- cmd/podman/pull.go | 3 ++- cmd/podman/push.go | 2 +- cmd/podman/save.go | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/podman/create.go b/cmd/podman/create.go index 5e2ea3969..3d811b58b 100644 --- a/cmd/podman/create.go +++ b/cmd/podman/create.go @@ -392,7 +392,7 @@ func imageData(c *cli.Context, runtime *libpod.Runtime, image string) (string, s // Pull the image var writer io.Writer if !c.Bool("quiet") { - writer = os.Stdout + writer = os.Stderr } createImage.Pull(writer) } diff --git a/cmd/podman/load.go b/cmd/podman/load.go index ee8a79756..d3a15a2ae 100644 --- a/cmd/podman/load.go +++ b/cmd/podman/load.go @@ -93,7 +93,7 @@ func loadCmd(c *cli.Context) error { var writer io.Writer if !c.Bool("quiet") { - writer = os.Stdout + writer = os.Stderr } options := libpod.CopyOptions{ diff --git a/cmd/podman/pull.go b/cmd/podman/pull.go index 886f82dd5..5dc9ef2d4 100644 --- a/cmd/podman/pull.go +++ b/cmd/podman/pull.go @@ -5,6 +5,7 @@ import ( "os" "fmt" + "github.com/containers/image/types" "github.com/pkg/errors" "github.com/projectatomic/libpod/libpod" @@ -90,7 +91,7 @@ func pullCmd(c *cli.Context) error { var writer io.Writer if !c.Bool("quiet") { - writer = os.Stdout + writer = os.Stderr } options := libpod.CopyOptions{ diff --git a/cmd/podman/push.go b/cmd/podman/push.go index 2f0d73ffa..e16b91611 100644 --- a/cmd/podman/push.go +++ b/cmd/podman/push.go @@ -118,7 +118,7 @@ func pushCmd(c *cli.Context) error { var writer io.Writer if !c.Bool("quiet") { - writer = os.Stdout + writer = os.Stderr } var manifestType string diff --git a/cmd/podman/save.go b/cmd/podman/save.go index 9ba1cc829..5ceb456f4 100644 --- a/cmd/podman/save.go +++ b/cmd/podman/save.go @@ -75,7 +75,7 @@ func saveCmd(c *cli.Context) error { var writer io.Writer if !c.Bool("quiet") { - writer = os.Stdout + writer = os.Stderr } output := c.String("output") -- cgit v1.2.3-54-g00ecf