diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-07-05 16:10:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-05 16:10:12 +0000 |
commit | 39fc5d1f4f26f82ed1ca23d97f43924335c4c529 (patch) | |
tree | e0a54c6d0e3a1bc238cb5ef4a9316b55b39217ee /pkg/domain/infra/abi/containers_runlabel.go | |
parent | 9539a89ee77682ed3f4d1d0be3b950523e2f2439 (diff) | |
parent | 251d91699de4e9aaab53ab6fea262d4b6bdaae8e (diff) | |
download | podman-39fc5d1f4f26f82ed1ca23d97f43924335c4c529.tar.gz podman-39fc5d1f4f26f82ed1ca23d97f43924335c4c529.tar.bz2 podman-39fc5d1f4f26f82ed1ca23d97f43924335c4c529.zip |
Merge pull request #14828 from saschagrunert/errors-libpod
libpod: switch to golang native error wrapping
Diffstat (limited to 'pkg/domain/infra/abi/containers_runlabel.go')
-rw-r--r-- | pkg/domain/infra/abi/containers_runlabel.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/domain/infra/abi/containers_runlabel.go b/pkg/domain/infra/abi/containers_runlabel.go index fac15f72d..463988c87 100644 --- a/pkg/domain/infra/abi/containers_runlabel.go +++ b/pkg/domain/infra/abi/containers_runlabel.go @@ -2,6 +2,7 @@ package abi import ( "context" + "errors" "fmt" "os" "path/filepath" @@ -14,7 +15,6 @@ import ( envLib "github.com/containers/podman/v4/pkg/env" "github.com/containers/podman/v4/utils" "github.com/google/shlex" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -40,7 +40,7 @@ func (ic *ContainerEngine) ContainerRunlabel(ctx context.Context, label string, } if len(pulledImages) != 1 { - return errors.Errorf("internal error: expected an image to be pulled (or an error)") + return errors.New("internal error: expected an image to be pulled (or an error)") } // Extract the runlabel from the image. @@ -57,7 +57,7 @@ func (ic *ContainerEngine) ContainerRunlabel(ctx context.Context, label string, } } if runlabel == "" { - return errors.Errorf("cannot find the value of label: %s in image: %s", label, imageRef) + return fmt.Errorf("cannot find the value of label: %s in image: %s", label, imageRef) } cmd, env, err := generateRunlabelCommand(runlabel, pulledImages[0], imageRef, args, options) @@ -86,7 +86,7 @@ func (ic *ContainerEngine) ContainerRunlabel(ctx context.Context, label string, name := cmd[i+1] ctr, err := ic.Libpod.LookupContainer(name) if err != nil { - if errors.Cause(err) != define.ErrNoSuchCtr { + if !errors.Is(err, define.ErrNoSuchCtr) { logrus.Debugf("Error occurred searching for container %s: %v", name, err) return err } |