From 837aad724ff1f7f4cc3b125b8b3419af29cd4982 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Mon, 30 Mar 2020 12:59:05 -0500 Subject: podmanv2 save image add ability to save an image for podman v2 Signed-off-by: Brent Baude --- pkg/bindings/images/images.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pkg/bindings') 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 -- cgit v1.2.3-54-g00ecf