summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-03-05 13:41:12 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-03-05 13:41:17 +0100
commit85db895012bead6b48aff9232d3429ed62fac045 (patch)
tree5b337a335e0da14d463105dc18fb687575361d95
parent4b80517b6a638ff06f8ad432f0f0f5839283d058 (diff)
downloadpodman-85db895012bead6b48aff9232d3429ed62fac045.tar.gz
podman-85db895012bead6b48aff9232d3429ed62fac045.tar.bz2
podman-85db895012bead6b48aff9232d3429ed62fac045.zip
rm: set exit code to 1 if a specified container is not found
Closes: https://github.com/containers/libpod/issues/2539 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r--cmd/podman/rm.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/podman/rm.go b/cmd/podman/rm.go
index 61b049840..d23f8228c 100644
--- a/cmd/podman/rm.go
+++ b/cmd/podman/rm.go
@@ -80,6 +80,9 @@ func rmCmd(c *cliconfig.RmValues) error {
return err
}
if err != nil {
+ if errors.Cause(err) == libpod.ErrNoSuchCtr {
+ exitCode = 1
+ }
fmt.Println(err.Error())
}
}