summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-08-01 13:37:19 +0200
committerGitHub <noreply@github.com>2019-08-01 13:37:19 +0200
commit6f62dac163dd935866c21e91e5cd623772907eda (patch)
treec54863804158f85e206352da00133c0f12c60f7e /pkg/varlinkapi
parentee15e76da0a032bad7cb94295dc32e2553f10850 (diff)
parent5370d9cb76a8075332f5ab6a0efef9fba28ba19b (diff)
downloadpodman-6f62dac163dd935866c21e91e5cd623772907eda.tar.gz
podman-6f62dac163dd935866c21e91e5cd623772907eda.tar.bz2
podman-6f62dac163dd935866c21e91e5cd623772907eda.zip
Merge pull request #3341 from rhatdan/exit
Add new exit codes to rm & rmi for running containers & dependencies
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r--pkg/varlinkapi/containers.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/varlinkapi/containers.go b/pkg/varlinkapi/containers.go
index cd5f305c9..bb66ff962 100644
--- a/pkg/varlinkapi/containers.go
+++ b/pkg/varlinkapi/containers.go
@@ -488,6 +488,12 @@ func (i *LibpodAPI) RemoveContainer(call iopodman.VarlinkCall, name string, forc
return call.ReplyContainerNotFound(name, err.Error())
}
if err := i.Runtime.RemoveContainer(ctx, ctr, force, removeVolumes); err != nil {
+ if errors.Cause(err) == define.ErrNoSuchCtr {
+ return call.ReplyContainerExists(1)
+ }
+ if errors.Cause(err) == define.ErrCtrStateInvalid {
+ return call.ReplyInvalidState(ctr.ID(), err.Error())
+ }
return call.ReplyErrorOccurred(err.Error())
}
return call.ReplyRemoveContainer(ctr.ID())