From 95dad4d8a443682e59c14a94035a111bab3e42fc Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 17 Mar 2022 14:51:54 +0100 Subject: podman rmi --ignore Add an `--ignore` flag to `podman image rm` to instruct ignoring image if a specified image does not exist and to not throw an error. Other commands (e.g., `podman container rm`) already support this flag. Such an `--ignore` flag can come in handy in clean-up scripcts such as the teardown phases in the Podman tests. Signed-off-by: Valentin Rothberg --- pkg/bindings/images/types.go | 2 ++ pkg/bindings/images/types_remove_options.go | 15 +++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'pkg/bindings/images') diff --git a/pkg/bindings/images/types.go b/pkg/bindings/images/types.go index a44a3527f..163365924 100644 --- a/pkg/bindings/images/types.go +++ b/pkg/bindings/images/types.go @@ -11,6 +11,8 @@ type RemoveOptions struct { All *bool // Forces removes all containers based on the image Force *bool + // Ignore if a specified image does not exist and do not throw an error. + Ignore *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 1fbe5f4ea..613a33183 100644 --- a/pkg/bindings/images/types_remove_options.go +++ b/pkg/bindings/images/types_remove_options.go @@ -46,3 +46,18 @@ func (o *RemoveOptions) GetForce() bool { } return *o.Force } + +// WithIgnore set field Ignore to given value +func (o *RemoveOptions) WithIgnore(value bool) *RemoveOptions { + o.Ignore = &value + return o +} + +// GetIgnore returns value of field Ignore +func (o *RemoveOptions) GetIgnore() bool { + if o.Ignore == nil { + var z bool + return z + } + return *o.Ignore +} -- cgit v1.2.3-54-g00ecf