From 2b89b241461c6baba777894f09a75df17dd05741 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Wed, 5 May 2021 16:38:32 -0400 Subject: Add support for podman manifest rm command This is mainly to match command line of Docker. Signed-off-by: Daniel J Walsh --- pkg/domain/entities/engine_image.go | 1 + pkg/domain/infra/abi/manifest.go | 5 +++++ pkg/domain/infra/tunnel/manifest.go | 5 +++++ 3 files changed, 11 insertions(+) (limited to 'pkg') diff --git a/pkg/domain/entities/engine_image.go b/pkg/domain/entities/engine_image.go index d841ecd6e..1b2de5d5e 100644 --- a/pkg/domain/entities/engine_image.go +++ b/pkg/domain/entities/engine_image.go @@ -37,6 +37,7 @@ type ImageEngine interface { ManifestAdd(ctx context.Context, opts ManifestAddOptions) (string, error) ManifestAnnotate(ctx context.Context, names []string, opts ManifestAnnotateOptions) (string, error) ManifestRemove(ctx context.Context, names []string) (string, error) + ManifestRm(ctx context.Context, names []string) (*ImageRemoveReport, []error) ManifestPush(ctx context.Context, name, destination string, imagePushOpts ImagePushOptions) (string, error) Sign(ctx context.Context, names []string, options SignOptions) (*SignReport, error) } diff --git a/pkg/domain/infra/abi/manifest.go b/pkg/domain/infra/abi/manifest.go index f932cf21d..4496b0226 100644 --- a/pkg/domain/infra/abi/manifest.go +++ b/pkg/domain/infra/abi/manifest.go @@ -320,6 +320,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) diff --git a/pkg/domain/infra/tunnel/manifest.go b/pkg/domain/infra/tunnel/manifest.go index 8ac1f1420..b8069405a 100644 --- a/pkg/domain/infra/tunnel/manifest.go +++ b/pkg/domain/infra/tunnel/manifest.go @@ -83,6 +83,11 @@ func (ir *ImageEngine) ManifestRemove(ctx context.Context, names []string) (stri return fmt.Sprintf("%s :%s\n", updatedListID, names[1]), nil } +// ManifestRm removes the specified manifest list from storage +func (ir *ImageEngine) ManifestRm(ctx context.Context, names []string) (*entities.ImageRemoveReport, []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) { options := new(images.PushOptions) -- cgit v1.2.3-54-g00ecf