summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/containers/create.go4
-rw-r--r--cmd/podman/containers/rm.go2
2 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go
index 5058cdfe5..bb6cb5fdd 100644
--- a/cmd/podman/containers/create.go
+++ b/cmd/podman/containers/create.go
@@ -6,6 +6,8 @@ import (
"os"
"strings"
+ "github.com/containers/libpod/libpod/define"
+
"github.com/containers/common/pkg/config"
"github.com/containers/libpod/cmd/podman/common"
"github.com/containers/libpod/cmd/podman/registry"
@@ -203,7 +205,7 @@ func pullImage(imageName string) error {
}
if !br.Value || pullPolicy == config.PullImageAlways {
if pullPolicy == config.PullImageNever {
- return errors.New("unable to find a name and tag match for busybox in repotags: no such image")
+ return errors.Wrapf(define.ErrNoSuchImage, "unable to find a name and tag match for %s in repotags", imageName)
}
_, pullErr := registry.ImageEngine().Pull(registry.GetContext(), imageName, entities.ImagePullOptions{
Authfile: cliVals.Authfile,
diff --git a/cmd/podman/containers/rm.go b/cmd/podman/containers/rm.go
index 5ef2e23be..f01462447 100644
--- a/cmd/podman/containers/rm.go
+++ b/cmd/podman/containers/rm.go
@@ -128,5 +128,7 @@ func setExitCode(err error) {
registry.SetExitCode(1)
case cause == define.ErrCtrStateInvalid:
registry.SetExitCode(2)
+ case strings.Contains(cause.Error(), define.ErrCtrStateInvalid.Error()):
+ registry.SetExitCode(2)
}
}