summaryrefslogtreecommitdiff
path: root/libpod/runtime_renumber.go
diff options
context:
space:
mode:
authorSascha Grunert <sgrunert@redhat.com>2022-06-30 16:47:21 +0200
committerSascha Grunert <sgrunert@redhat.com>2022-07-04 15:39:00 +0200
commit597de7a083c329bdaed7fc469555a4142f71bcb8 (patch)
tree5f49d85e2f273a71520dc4b391f051cb1cbf3d07 /libpod/runtime_renumber.go
parent3e8ab312395b32d0b43f1ac82adf53439b012893 (diff)
downloadpodman-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_renumber.go')
-rw-r--r--libpod/runtime_renumber.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/libpod/runtime_renumber.go b/libpod/runtime_renumber.go
index db055f40b..9149dd72f 100644
--- a/libpod/runtime_renumber.go
+++ b/libpod/runtime_renumber.go
@@ -1,8 +1,9 @@
package libpod
import (
+ "fmt"
+
"github.com/containers/podman/v4/libpod/events"
- "github.com/pkg/errors"
)
// renumberLocks reassigns lock numbers for all containers and pods in the
@@ -26,7 +27,7 @@ func (r *Runtime) renumberLocks() error {
for _, ctr := range allCtrs {
lock, err := r.lockManager.AllocateLock()
if err != nil {
- return errors.Wrapf(err, "error allocating lock for container %s", ctr.ID())
+ return fmt.Errorf("error allocating lock for container %s: %w", ctr.ID(), err)
}
ctr.config.LockID = lock.ID()
@@ -43,7 +44,7 @@ func (r *Runtime) renumberLocks() error {
for _, pod := range allPods {
lock, err := r.lockManager.AllocateLock()
if err != nil {
- return errors.Wrapf(err, "error allocating lock for pod %s", pod.ID())
+ return fmt.Errorf("error allocating lock for pod %s: %w", pod.ID(), err)
}
pod.config.LockID = lock.ID()
@@ -60,7 +61,7 @@ func (r *Runtime) renumberLocks() error {
for _, vol := range allVols {
lock, err := r.lockManager.AllocateLock()
if err != nil {
- return errors.Wrapf(err, "error allocating lock for volume %s", vol.Name())
+ return fmt.Errorf("error allocating lock for volume %s: %w", vol.Name(), err)
}
vol.config.LockID = lock.ID()