summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-11 17:13:53 -0500
committerGitHub <noreply@github.com>2021-01-11 17:13:53 -0500
commita6510892635d57dfcfbacbe910155e380612b057 (patch)
tree20d62dc5d6cade82830a2741ef419d938c0eace9
parent63d8f535ec93b5e83257e39b9d656747c4bedfcc (diff)
parent1d7e5227f874dc3d2511a73a6f3d69550e62b303 (diff)
downloadpodman-a6510892635d57dfcfbacbe910155e380612b057.tar.gz
podman-a6510892635d57dfcfbacbe910155e380612b057.tar.bz2
podman-a6510892635d57dfcfbacbe910155e380612b057.zip
Merge pull request #8934 from vrothberg/fix-8931
image list: ignore bare manifest list
-rw-r--r--pkg/domain/infra/abi/images_list.go5
-rw-r--r--test/system/010-images.bats13
2 files changed, 17 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/images_list.go b/pkg/domain/infra/abi/images_list.go
index c4b0b7712..2d3b9f36a 100644
--- a/pkg/domain/infra/abi/images_list.go
+++ b/pkg/domain/infra/abi/images_list.go
@@ -44,7 +44,10 @@ func (ir *ImageEngine) List(ctx context.Context, opts entities.ImageListOptions)
}
e.Labels, err = img.Labels(ctx)
if err != nil {
- return nil, errors.Wrapf(err, "error retrieving label for image %q: you may need to remove the image to resolve the error", img.ID())
+ // Ignore empty manifest lists.
+ if errors.Cause(err) != libpodImage.ErrImageIsBareList {
+ return nil, errors.Wrapf(err, "error retrieving label for image %q: you may need to remove the image to resolve the error", img.ID())
+ }
}
ctnrs, err := img.Containers()
diff --git a/test/system/010-images.bats b/test/system/010-images.bats
index 76caf282b..e7c88408e 100644
--- a/test/system/010-images.bats
+++ b/test/system/010-images.bats
@@ -228,4 +228,17 @@ Labels.created_at | 20[0-9-]\\\+T[0-9:]\\\+Z
run_podman rmi ${aaa_name}:${aaa_tag} ${zzz_name}:${zzz_tag}
}
+# Regression test for #8931
+@test "podman images - bare manifest list" {
+ # Create an empty manifest list and list images.
+
+ run_podman inspect --format '{{.ID}}' $IMAGE
+ iid=$output
+
+ run_podman manifest create test:1.0
+ run_podman images --format '{{.ID}}' --no-trunc
+ [[ "$output" == *"sha256:$iid"* ]]
+
+ run_podman rmi test:1.0
+}
# vim: filetype=sh