diff options
author | Aditya R <arajan@redhat.com> | 2022-06-30 11:33:28 +0530 |
---|---|---|
committer | Aditya R <arajan@redhat.com> | 2022-06-30 14:56:42 +0530 |
commit | 7bbfb3eb0d9c711332b5d96963bbc8db28bf6115 (patch) | |
tree | a06c4d46502c889f468e5ef3f1ec693331230662 /pkg/bindings/images | |
parent | 3426d56b92be2ac1c3cc62fc578e9cb6d64aca81 (diff) | |
download | podman-7bbfb3eb0d9c711332b5d96963bbc8db28bf6115.tar.gz podman-7bbfb3eb0d9c711332b5d96963bbc8db28bf6115.tar.bz2 podman-7bbfb3eb0d9c711332b5d96963bbc8db28bf6115.zip |
api,images: add support for LookupManifest to Image remove API
ImagesBatchRemoval and ImageRemoval now honors and accepts
`LookupManifest` parameter which further tells libimage to resolve to
manifest list if it exists instead of actual image.
Following PR also makes `podman-remote manifest rm` functional which was
broken till now.
Closes: https://github.com/containers/podman/issues/14763
Signed-off-by: Aditya R <arajan@redhat.com>
Diffstat (limited to 'pkg/bindings/images')
-rw-r--r-- | pkg/bindings/images/types.go | 2 | ||||
-rw-r--r-- | pkg/bindings/images/types_remove_options.go | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/pkg/bindings/images/types.go b/pkg/bindings/images/types.go index 2c00c20cd..3728ae5c0 100644 --- a/pkg/bindings/images/types.go +++ b/pkg/bindings/images/types.go @@ -13,6 +13,8 @@ type RemoveOptions struct { Force *bool // Ignore if a specified image does not exist and do not throw an error. Ignore *bool + // Confirms if given name is a manifest list and removes it, otherwise returns error. + LookupManifest *bool } //go:generate go run ../generator/generator.go DiffOptions diff --git a/pkg/bindings/images/types_remove_options.go b/pkg/bindings/images/types_remove_options.go index 613a33183..559ebcfd5 100644 --- a/pkg/bindings/images/types_remove_options.go +++ b/pkg/bindings/images/types_remove_options.go @@ -61,3 +61,18 @@ func (o *RemoveOptions) GetIgnore() bool { } return *o.Ignore } + +// WithLookupManifest set field LookupManifest to given value +func (o *RemoveOptions) WithLookupManifest(value bool) *RemoveOptions { + o.LookupManifest = &value + return o +} + +// GetLookupManifest returns value of field LookupManifest +func (o *RemoveOptions) GetLookupManifest() bool { + if o.LookupManifest == nil { + var z bool + return z + } + return *o.LookupManifest +} |