From 2624c043d1b8aef69355616037ee2305298bd08a Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Tue, 19 May 2020 13:34:01 -0500 Subject: Test fixes for remote integration Signed-off-by: Brent Baude --- cmd/podman/containers/create.go | 4 +++- cmd/podman/containers/rm.go | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'cmd/podman') 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) } } -- cgit v1.2.3-54-g00ecf