From 4ddcbd7941e8cb32cbdcac2f1aa3a939e82be764 Mon Sep 17 00:00:00 2001 From: baude Date: Tue, 4 Sep 2018 12:33:29 -0500 Subject: rmi remove all not error when no images are present When running podman rm -a on a storage where no images exist, the exit code should NOT be non-zero. Signed-off-by: baude Closes: #1402 Approved by: rhatdan --- cmd/podman/rmi.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmd/podman') diff --git a/cmd/podman/rmi.go b/cmd/podman/rmi.go index e29f32c7c..fdeab6b80 100644 --- a/cmd/podman/rmi.go +++ b/cmd/podman/rmi.go @@ -111,6 +111,13 @@ func rmiCmd(c *cli.Context) error { } } + // If the user calls remove all and there are none, it should not be a + // non-zero exit + if !deleted && removeAll { + return nil + } + // the user tries to remove images that do not exist, that should be a + // non-zero exit if !deleted { return errors.Errorf("no valid images to delete") } -- cgit v1.2.3-54-g00ecf