diff options
author | Sascha Grunert <sgrunert@redhat.com> | 2022-06-30 16:47:21 +0200 |
---|---|---|
committer | Sascha Grunert <sgrunert@redhat.com> | 2022-07-04 15:39:00 +0200 |
commit | 597de7a083c329bdaed7fc469555a4142f71bcb8 (patch) | |
tree | 5f49d85e2f273a71520dc4b391f051cb1cbf3d07 /libpod/runtime_volume.go | |
parent | 3e8ab312395b32d0b43f1ac82adf53439b012893 (diff) | |
download | podman-597de7a083c329bdaed7fc469555a4142f71bcb8.tar.gz podman-597de7a083c329bdaed7fc469555a4142f71bcb8.tar.bz2 podman-597de7a083c329bdaed7fc469555a4142f71bcb8.zip |
libpod/runtime: 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 'libpod/runtime_volume.go')
-rw-r--r-- | libpod/runtime_volume.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libpod/runtime_volume.go b/libpod/runtime_volume.go index 6872db21d..9efb30e03 100644 --- a/libpod/runtime_volume.go +++ b/libpod/runtime_volume.go @@ -2,11 +2,11 @@ package libpod import ( "context" + "errors" "github.com/containers/podman/v4/libpod/define" "github.com/containers/podman/v4/libpod/events" "github.com/containers/podman/v4/pkg/domain/entities/reports" - "github.com/pkg/errors" ) // Contains the public Runtime API for volumes @@ -133,7 +133,7 @@ func (r *Runtime) PruneVolumes(ctx context.Context, filterFuncs []VolumeFilter) report.Id = vol.Name() var timeout *uint if err := r.RemoveVolume(ctx, vol, false, timeout); err != nil { - if errors.Cause(err) != define.ErrVolumeBeingUsed && errors.Cause(err) != define.ErrVolumeRemoved { + if !errors.Is(err, define.ErrVolumeBeingUsed) && !errors.Is(err, define.ErrVolumeRemoved) { report.Err = err } else { // We didn't remove the volume for some reason |