diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-09-22 10:54:23 +0200 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2020-09-25 10:57:30 -0400 |
commit | bc8ada648a748198ec0cae706f18398e6b91c803 (patch) | |
tree | 62620d713e43a5f1191789ce5ee95a166c5be4d4 /cmd/podman/images/save.go | |
parent | 17db9851d05544ef49f8bce0deec452a99aae2a9 (diff) | |
download | podman-bc8ada648a748198ec0cae706f18398e6b91c803.tar.gz podman-bc8ada648a748198ec0cae706f18398e6b91c803.tar.bz2 podman-bc8ada648a748198ec0cae706f18398e6b91c803.zip |
podman save: fix redirect of multi-images
Fix a bug when saving multi-image archives where the progress bars from
copying images was accidentally written to the archive and hence
corrupted it.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'cmd/podman/images/save.go')
-rw-r--r-- | cmd/podman/images/save.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/cmd/podman/images/save.go b/cmd/podman/images/save.go index c57f61221..b164a2534 100644 --- a/cmd/podman/images/save.go +++ b/cmd/podman/images/save.go @@ -94,6 +94,7 @@ func save(cmd *cobra.Command, args []string) (finalErr error) { return errors.Errorf("--compress can only be set when --format is either 'oci-dir' or 'docker-dir'") } if len(saveOpts.Output) == 0 { + saveOpts.Quiet = true fi := os.Stdout if terminal.IsTerminal(int(fi.Fd())) { return errors.Errorf("refusing to save to terminal. Use -o flag or redirect") @@ -122,12 +123,6 @@ func save(cmd *cobra.Command, args []string) (finalErr error) { tags = args[1:] } - // Decide whether c/image's progress bars should use stderr or stdout. - // If the output is set of stdout, any log message there would corrupt - // the tarfile. - if saveOpts.Output == os.Stdout.Name() { - saveOpts.Quiet = true - } err := registry.ImageEngine().Save(context.Background(), args[0], tags, saveOpts) if err == nil { succeeded = true |