diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-13 06:03:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-13 06:03:51 -0500 |
commit | 85460bc41cb67e668bc8b7196346685691953176 (patch) | |
tree | dc468234187ffb7c1c1eff0133d237babbea1b8b /libpod/runtime_img.go | |
parent | f52a9eeeea75fe84fceb6aa347888d61a5cecd59 (diff) | |
parent | a6046dceeff21bbeea71c0ab5c3d78ff931aa019 (diff) | |
download | podman-85460bc41cb67e668bc8b7196346685691953176.tar.gz podman-85460bc41cb67e668bc8b7196346685691953176.tar.bz2 podman-85460bc41cb67e668bc8b7196346685691953176.zip |
Merge pull request #8877 from rhatdan/load
Remove the ability to use [name:tag] in podman load command
Diffstat (limited to 'libpod/runtime_img.go')
-rw-r--r-- | libpod/runtime_img.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go index 965333f77..2c5442bd2 100644 --- a/libpod/runtime_img.go +++ b/libpod/runtime_img.go @@ -279,6 +279,7 @@ func (r *Runtime) LoadImage(ctx context.Context, inputFile string, writer io.Wri if newImages, err := r.LoadAllImageFromArchive(ctx, writer, inputFile, signaturePolicy); err == nil { return newImages, nil } + return r.LoadImageFromSingleImageArchive(ctx, writer, inputFile, signaturePolicy) } @@ -293,7 +294,7 @@ func (r *Runtime) LoadAllImageFromArchive(ctx context.Context, writer io.Writer, // LoadImageFromSingleImageArchive load image from the archive of single image that inputFile points to. func (r *Runtime) LoadImageFromSingleImageArchive(ctx context.Context, writer io.Writer, inputFile, signaturePolicy string) (string, error) { - var err error + var saveErr error for _, referenceFn := range []func() (types.ImageReference, error){ func() (types.ImageReference, error) { return dockerarchive.ParseReference(inputFile) @@ -312,10 +313,12 @@ func (r *Runtime) LoadImageFromSingleImageArchive(ctx context.Context, writer io if err == nil && src != nil { if newImages, err := r.ImageRuntime().LoadFromArchiveReference(ctx, src, signaturePolicy, writer); err == nil { return getImageNames(newImages), nil + } else { + saveErr = err } } } - return "", errors.Wrapf(err, "error pulling image") + return "", errors.Wrapf(saveErr, "error pulling image") } func getImageNames(images []*image.Image) string { |