summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-02 10:27:16 -0400
committerGitHub <noreply@github.com>2021-09-02 10:27:16 -0400
commit469900406ac51332785455bc8668bd1c053badd6 (patch)
tree7eb39b91c2b9e235cda5298d604c517244c0836e /pkg
parentafa9987f876b08647e419e798a738f0f98e47600 (diff)
parentcba114dd3617b7f793fa43817058d40505f4d454 (diff)
downloadpodman-469900406ac51332785455bc8668bd1c053badd6.tar.gz
podman-469900406ac51332785455bc8668bd1c053badd6.tar.bz2
podman-469900406ac51332785455bc8668bd1c053badd6.zip
Merge pull request #11406 from flouthoc/manifest-rm-only-manifest
manifest: `rm` should not remove referenced images.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/domain/entities/images.go2
-rw-r--r--pkg/domain/infra/abi/images.go1
-rw-r--r--pkg/domain/infra/abi/manifest.go2
-rw-r--r--pkg/domain/infra/tunnel/manifest.go2
4 files changed, 5 insertions, 2 deletions
diff --git a/pkg/domain/entities/images.go b/pkg/domain/entities/images.go
index 262b09cad..c575212b1 100644
--- a/pkg/domain/entities/images.go
+++ b/pkg/domain/entities/images.go
@@ -89,6 +89,8 @@ type ImageRemoveOptions struct {
All bool
// Foce will force image removal including containers using the images.
Force bool
+ // Confirms if given name is a manifest list and removes it, otherwise returns error.
+ LookupManifest bool
}
// ImageRemoveResponse is the response for removing one or more image(s) from storage
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index e8739615d..a88d38a10 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -521,6 +521,7 @@ func (ir *ImageEngine) Remove(ctx context.Context, images []string, opts entitie
libimageOptions := &libimage.RemoveImagesOptions{}
libimageOptions.Filters = []string{"readonly=false"}
libimageOptions.Force = opts.Force
+ libimageOptions.LookupManifest = opts.LookupManifest
if !opts.All {
libimageOptions.Filters = append(libimageOptions.Filters, "intermediate=false")
}
diff --git a/pkg/domain/infra/abi/manifest.go b/pkg/domain/infra/abi/manifest.go
index 666bc997d..1dd0686ac 100644
--- a/pkg/domain/infra/abi/manifest.go
+++ b/pkg/domain/infra/abi/manifest.go
@@ -306,7 +306,7 @@ func (ir *ImageEngine) ManifestRemove(ctx context.Context, names []string) (stri
// 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{})
+ return ir.Remove(ctx, names, entities.ImageRemoveOptions{LookupManifest: true})
}
// ManifestPush pushes a manifest list or image index to the destination
diff --git a/pkg/domain/infra/tunnel/manifest.go b/pkg/domain/infra/tunnel/manifest.go
index b8069405a..62634f561 100644
--- a/pkg/domain/infra/tunnel/manifest.go
+++ b/pkg/domain/infra/tunnel/manifest.go
@@ -85,7 +85,7 @@ func (ir *ImageEngine) ManifestRemove(ctx context.Context, names []string) (stri
// 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{})
+ return ir.Remove(ctx, names, entities.ImageRemoveOptions{LookupManifest: true})
}
// ManifestPush pushes a manifest list or image index to the destination