summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-01-04 13:31:57 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2021-01-12 17:38:32 -0500
commita6046dceeff21bbeea71c0ab5c3d78ff931aa019 (patch)
treedc468234187ffb7c1c1eff0133d237babbea1b8b /libpod
parent3ff8f2765129b4edd7f8902cf1605db4fdabf034 (diff)
downloadpodman-a6046dceeff21bbeea71c0ab5c3d78ff931aa019.tar.gz
podman-a6046dceeff21bbeea71c0ab5c3d78ff931aa019.tar.bz2
podman-a6046dceeff21bbeea71c0ab5c3d78ff931aa019.zip
Remove the ability to use [name:tag] in podman load command
Docker does not support this, and it is confusing what to do if the image has more then one tag. We are dropping support for this in podman 3.0 Fixes: https://github.com/containers/podman/issues/7387 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/runtime_img.go7
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 {