summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/manifest.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/domain/infra/abi/manifest.go')
-rw-r--r--pkg/domain/infra/abi/manifest.go33
1 files changed, 13 insertions, 20 deletions
diff --git a/pkg/domain/infra/abi/manifest.go b/pkg/domain/infra/abi/manifest.go
index f932cf21d..7e5477f4f 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()
@@ -320,6 +308,11 @@ func (ir *ImageEngine) ManifestRemove(ctx context.Context, names []string) (stri
return manifestList.ID(), nil
}
+// ManifestRm removes the specified manifest list from storage
+func (ir *ImageEngine) ManifestRm(ctx context.Context, names []string) (report *entities.ImageRemoveReport, rmErrors []error) {
+ return ir.Remove(ctx, names, entities.ImageRemoveOptions{})
+}
+
// ManifestPush pushes a manifest list or image index to the destination
func (ir *ImageEngine) ManifestPush(ctx context.Context, name, destination string, opts entities.ImagePushOptions) (string, error) {
manifestList, err := ir.Libpod.LibimageRuntime().LookupManifestList(name)