diff options
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r-- | pkg/varlinkapi/containers.go | 6 | ||||
-rw-r--r-- | pkg/varlinkapi/images.go | 2 |
2 files changed, 7 insertions, 1 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()) diff --git a/pkg/varlinkapi/images.go b/pkg/varlinkapi/images.go index 739a3e582..338499bd4 100644 --- a/pkg/varlinkapi/images.go +++ b/pkg/varlinkapi/images.go @@ -161,7 +161,7 @@ func (i *LibpodAPI) BuildImage(call iopodman.VarlinkCall, config iopodman.BuildI } hostNetwork := buildah.NamespaceOption{ - Name: specs.NetworkNamespace, + Name: string(specs.NetworkNamespace), Host: true, } |