Skip to content

Commit

Permalink
Merge pull request #8934 from vrothberg/fix-8931
Browse files Browse the repository at this point in the history
image list: ignore bare manifest list
  • Loading branch information
openshift-merge-robot authored Jan 11, 2021
2 parents 63d8f53 + 1d7e522 commit a651089
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/domain/infra/abi/images_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
13 changes: 13 additions & 0 deletions test/system/010-images.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a651089

Please sign in to comment.