diff options
author | Sascha Grunert <sgrunert@redhat.com> | 2022-07-05 11:42:22 +0200 |
---|---|---|
committer | Sascha Grunert <sgrunert@redhat.com> | 2022-07-05 16:06:32 +0200 |
commit | 251d91699de4e9aaab53ab6fea262d4b6bdaae8e (patch) | |
tree | 1995c85a69f48bf129565ca60ea0b3d6205a04b4 /pkg/domain/infra/tunnel/pods.go | |
parent | 340eeed0cb20855f1e6d2670704cfe67df3314f6 (diff) | |
download | podman-251d91699de4e9aaab53ab6fea262d4b6bdaae8e.tar.gz podman-251d91699de4e9aaab53ab6fea262d4b6bdaae8e.tar.bz2 podman-251d91699de4e9aaab53ab6fea262d4b6bdaae8e.zip |
libpod: switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.
[NO NEW TESTS NEEDED]
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Diffstat (limited to 'pkg/domain/infra/tunnel/pods.go')
-rw-r--r-- | pkg/domain/infra/tunnel/pods.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/domain/infra/tunnel/pods.go b/pkg/domain/infra/tunnel/pods.go index 7b1fa231f..a524f9f89 100644 --- a/pkg/domain/infra/tunnel/pods.go +++ b/pkg/domain/infra/tunnel/pods.go @@ -2,12 +2,12 @@ package tunnel import ( "context" + "errors" "github.com/containers/podman/v4/libpod/define" "github.com/containers/podman/v4/pkg/bindings/pods" "github.com/containers/podman/v4/pkg/domain/entities" "github.com/containers/podman/v4/pkg/util" - "github.com/pkg/errors" ) func (ic *ContainerEngine) PodExists(ctx context.Context, nameOrID string) (*entities.BoolReport, error) { @@ -97,7 +97,7 @@ func (ic *ContainerEngine) PodUnpause(ctx context.Context, namesOrIds []string, func (ic *ContainerEngine) PodStop(ctx context.Context, namesOrIds []string, opts entities.PodStopOptions) ([]*entities.PodStopReport, error) { timeout := -1 foundPods, err := getPodsByContext(ic.ClientCtx, opts.All, namesOrIds) - if err != nil && !(opts.Ignore && errors.Cause(err) == define.ErrNoSuchPod) { + if err != nil && !(opts.Ignore && errors.Is(err, define.ErrNoSuchPod)) { return nil, err } if opts.Timeout != -1 { @@ -164,7 +164,7 @@ func (ic *ContainerEngine) PodStart(ctx context.Context, namesOrIds []string, op func (ic *ContainerEngine) PodRm(ctx context.Context, namesOrIds []string, opts entities.PodRmOptions) ([]*entities.PodRmReport, error) { foundPods, err := getPodsByContext(ic.ClientCtx, opts.All, namesOrIds) - if err != nil && !(opts.Ignore && errors.Cause(err) == define.ErrNoSuchPod) { + if err != nil && !(opts.Ignore && errors.Is(err, define.ErrNoSuchPod)) { return nil, err } reports := make([]*entities.PodRmReport, 0, len(foundPods)) |