diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-06-23 13:05:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-23 13:05:31 -0400 |
commit | 7ed18eaec6a3ad6aff45cec79fdb15e7ffb6396c (patch) | |
tree | b8d6e6c38c0efa5b48743b2b4e8bd96c3f7398c4 /pkg/bindings/images/pull.go | |
parent | 3322ea2c68e1bac86748534615fd35c19bc0a655 (diff) | |
parent | 5fc622f945de46db85c8cc0284f935bac1929e3a (diff) | |
download | podman-7ed18eaec6a3ad6aff45cec79fdb15e7ffb6396c.tar.gz podman-7ed18eaec6a3ad6aff45cec79fdb15e7ffb6396c.tar.bz2 podman-7ed18eaec6a3ad6aff45cec79fdb15e7ffb6396c.zip |
Merge pull request #10739 from vrothberg/fix-10682
create: support images with invalid platform
Diffstat (limited to 'pkg/bindings/images/pull.go')
-rw-r--r-- | pkg/bindings/images/pull.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg/bindings/images/pull.go b/pkg/bindings/images/pull.go index 9780c3bff..7dfe9560c 100644 --- a/pkg/bindings/images/pull.go +++ b/pkg/bindings/images/pull.go @@ -13,7 +13,7 @@ import ( "github.com/containers/podman/v3/pkg/auth" "github.com/containers/podman/v3/pkg/bindings" "github.com/containers/podman/v3/pkg/domain/entities" - "github.com/hashicorp/go-multierror" + "github.com/containers/podman/v3/pkg/errorhandling" "github.com/pkg/errors" ) @@ -65,7 +65,7 @@ func Pull(ctx context.Context, rawImage string, options *PullOptions) ([]string, dec := json.NewDecoder(response.Body) var images []string - var mErr error + var pullErrors []error for { var report entities.ImagePullReport if err := dec.Decode(&report); err != nil { @@ -77,7 +77,7 @@ func Pull(ctx context.Context, rawImage string, options *PullOptions) ([]string, select { case <-response.Request.Context().Done(): - return images, mErr + break default: // non-blocking select } @@ -86,7 +86,7 @@ func Pull(ctx context.Context, rawImage string, options *PullOptions) ([]string, case report.Stream != "": fmt.Fprint(stderr, report.Stream) case report.Error != "": - mErr = multierror.Append(mErr, errors.New(report.Error)) + pullErrors = append(pullErrors, errors.New(report.Error)) case len(report.Images) > 0: images = report.Images case report.ID != "": @@ -94,5 +94,5 @@ func Pull(ctx context.Context, rawImage string, options *PullOptions) ([]string, return images, errors.Errorf("failed to parse pull results stream, unexpected input: %v", report) } } - return images, mErr + return images, errorhandling.JoinErrors(pullErrors) } |