diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-20 01:45:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-20 01:45:00 +0200 |
commit | 4eee0d840f0af81560d89864ea64b95c9e70b18d (patch) | |
tree | 684b0400d186ef9f6c20314a951f10ecec185bae /cmd/podman | |
parent | 0f8ad039235137d086b9fea33bb74b362e625cdd (diff) | |
parent | 8ec08a426e7024d597281dc0af9168f340e10d5d (diff) | |
download | podman-4eee0d840f0af81560d89864ea64b95c9e70b18d.tar.gz podman-4eee0d840f0af81560d89864ea64b95c9e70b18d.tar.bz2 podman-4eee0d840f0af81560d89864ea64b95c9e70b18d.zip |
Merge pull request #6177 from baude/v2enableremote
v2 enable remote integration tests
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/containers/rm.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd/podman/containers/rm.go b/cmd/podman/containers/rm.go index 2a0f9cc6a..5ef2e23be 100644 --- a/cmd/podman/containers/rm.go +++ b/cmd/podman/containers/rm.go @@ -3,6 +3,7 @@ package containers import ( "context" "fmt" + "strings" "github.com/containers/libpod/cmd/podman/parse" "github.com/containers/libpod/cmd/podman/registry" @@ -120,10 +121,12 @@ func rm(cmd *cobra.Command, args []string) error { func setExitCode(err error) { cause := errors.Cause(err) - switch cause { - case define.ErrNoSuchCtr: + switch { + case cause == define.ErrNoSuchCtr: registry.SetExitCode(1) - case define.ErrCtrStateInvalid: + case strings.Contains(cause.Error(), define.ErrNoSuchImage.Error()): + registry.SetExitCode(1) + case cause == define.ErrCtrStateInvalid: registry.SetExitCode(2) } } |