summaryrefslogtreecommitdiff
path: root/cmd/podman/images/rm.go
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-03-17 14:51:54 +0100
committerValentin Rothberg <vrothberg@redhat.com>2022-03-19 10:05:43 +0100
commit95dad4d8a443682e59c14a94035a111bab3e42fc (patch)
tree33ca2ad0601038d36ee0c687367155450e2a1b56 /cmd/podman/images/rm.go
parentc2eae35c606382418c6e2ce57c4ab874f1975f21 (diff)
downloadpodman-95dad4d8a443682e59c14a94035a111bab3e42fc.tar.gz
podman-95dad4d8a443682e59c14a94035a111bab3e42fc.tar.bz2
podman-95dad4d8a443682e59c14a94035a111bab3e42fc.zip
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 <vrothberg@redhat.com>
Diffstat (limited to 'cmd/podman/images/rm.go')
-rw-r--r--cmd/podman/images/rm.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmd/podman/images/rm.go b/cmd/podman/images/rm.go
index dd138d410..13dab62d4 100644
--- a/cmd/podman/images/rm.go
+++ b/cmd/podman/images/rm.go
@@ -56,6 +56,7 @@ func init() {
func imageRemoveFlagSet(flags *pflag.FlagSet) {
flags.BoolVarP(&imageOpts.All, "all", "a", false, "Remove all images")
+ flags.BoolVarP(&imageOpts.Ignore, "ignore", "i", false, "Ignore errors if a specified image does not exist")
flags.BoolVarP(&imageOpts.Force, "force", "f", false, "Force Removal of the image")
}