diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2021-05-18 10:05:03 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2021-05-20 10:21:27 +0200 |
commit | 898a8ad28514f90e13b05707a0ead148caa33541 (patch) | |
tree | 5992a9a2a39e17d335e8f468aa4f546c2a18c91c /pkg/domain/infra/abi/manifest.go | |
parent | 8bc39f4a90a658e92305369cc2628e2a65874506 (diff) | |
download | podman-898a8ad28514f90e13b05707a0ead148caa33541.tar.gz podman-898a8ad28514f90e13b05707a0ead148caa33541.tar.bz2 podman-898a8ad28514f90e13b05707a0ead148caa33541.zip |
update c/common
Update containers common to the latest HEAD. Some bug fixes in libimage
forced us to have a clearer separation between ordinary images and
manifest lists. Hence, when looking up manifest lists without recursing
into any of their instances, we need to use `LookupManifestList()`.
Also account for some other changes in c/common (e.g., the changed order
in the security labels).
Further vendor the latest HEAD from Buildah which is required to get the
bud tests to pass.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi/manifest.go')
-rw-r--r-- | pkg/domain/infra/abi/manifest.go | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/pkg/domain/infra/abi/manifest.go b/pkg/domain/infra/abi/manifest.go index f932cf21d..0972bdbfc 100644 --- a/pkg/domain/infra/abi/manifest.go +++ b/pkg/domain/infra/abi/manifest.go @@ -68,29 +68,17 @@ func (ir *ImageEngine) ManifestInspect(ctx context.Context, name string) ([]byte // inspect foo` wants to do a remote-inspect of foo iff "foo" in the // containers storage is an ordinary image but not a manifest list. - lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true} - image, _, err := ir.Libpod.LibimageRuntime().LookupImage(name, lookupOptions) + manifestList, err := ir.Libpod.LibimageRuntime().LookupManifestList(name) if err != nil { - // If the image doesn't exist, do a remote inspect. - if errors.Cause(err) == storage.ErrImageUnknown { + switch errors.Cause(err) { + // Do a remote inspect if there's no local image or if the + // local image is not a manifest list. + case storage.ErrImageUnknown, libimage.ErrNotAManifestList: return ir.remoteManifestInspect(ctx, name) - } - return nil, err - } - isManifestList, err := image.IsManifestList(ctx) - if err != nil { - return nil, err - } - - // If the image isn't a manifest list, do a remote inspect. - if !isManifestList { - return ir.remoteManifestInspect(ctx, name) - } - - manifestList, err := image.ToManifestList() - if err != nil { - return nil, err + default: + return nil, err + } } schema2List, err := manifestList.Inspect() |