diff options
author | Brent Baude <bbaude@redhat.com> | 2020-03-30 12:59:05 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-04-03 13:07:35 -0500 |
commit | 837aad724ff1f7f4cc3b125b8b3419af29cd4982 (patch) | |
tree | 25ad8d10028a7d742e9fd61d1c96d87fbc342090 /pkg/bindings | |
parent | a89d62ac3a445a5d76bd72d4b8e1bb9262ba74c6 (diff) | |
download | podman-837aad724ff1f7f4cc3b125b8b3419af29cd4982.tar.gz podman-837aad724ff1f7f4cc3b125b8b3419af29cd4982.tar.bz2 podman-837aad724ff1f7f4cc3b125b8b3419af29cd4982.zip |
podmanv2 save image
add ability to save an image for podman v2
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/bindings')
-rw-r--r-- | pkg/bindings/images/images.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/bindings/images/images.go b/pkg/bindings/images/images.go index dcb568d6b..1b3df609b 100644 --- a/pkg/bindings/images/images.go +++ b/pkg/bindings/images/images.go @@ -146,11 +146,12 @@ func Export(ctx context.Context, nameOrID string, w io.Writer, format *string, c if err != nil { return err } - if err := response.Process(nil); err != nil { + + if response.StatusCode/100 == 2 || response.StatusCode/100 == 3 { + _, err = io.Copy(w, response.Body) return err } - _, err = io.Copy(w, response.Body) - return err + return nil } // Prune removes unused images from local storage. The optional filters can be used to further |