summaryrefslogtreecommitdiff
path: root/pkg/rootless/rootless.go
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-03-21 15:47:01 +0100
committerValentin Rothberg <vrothberg@redhat.com>2022-03-22 13:15:28 +0100
commit06dd9136a253521cb74497a59f2e6894806a5b6d (patch)
treed6728a4ffd1d15b5abe415b5574bfdab14eb7fea /pkg/rootless/rootless.go
parent6c030cd5737a6257e9b7ee2db232a24ccef294de (diff)
downloadpodman-06dd9136a253521cb74497a59f2e6894806a5b6d.tar.gz
podman-06dd9136a253521cb74497a59f2e6894806a5b6d.tar.bz2
podman-06dd9136a253521cb74497a59f2e6894806a5b6d.zip
fix a number of errcheck issues
Numerous issues remain, especially in tests/e2e. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'pkg/rootless/rootless.go')
-rw-r--r--pkg/rootless/rootless.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/rootless/rootless.go b/pkg/rootless/rootless.go
index f526aa9e1..13f8078e2 100644
--- a/pkg/rootless/rootless.go
+++ b/pkg/rootless/rootless.go
@@ -1,6 +1,8 @@
package rootless
import (
+ "errors"
+ "fmt"
"os"
"sort"
"sync"
@@ -8,7 +10,6 @@ import (
"github.com/containers/storage/pkg/lockfile"
"github.com/opencontainers/runc/libcontainer/user"
spec "github.com/opencontainers/runtime-spec/specs-go"
- "github.com/pkg/errors"
)
// TryJoinPauseProcess attempts to join the namespaces of the pause PID via
@@ -16,7 +17,7 @@ import (
// file.
func TryJoinPauseProcess(pausePidPath string) (bool, int, error) {
if _, err := os.Stat(pausePidPath); err != nil {
- if os.IsNotExist(err) {
+ if errors.Is(err, os.ErrNotExist) {
return false, -1, nil
}
return false, -1, err
@@ -34,7 +35,7 @@ func TryJoinPauseProcess(pausePidPath string) (bool, int, error) {
if os.IsNotExist(err) {
return false, -1, nil
}
- return false, -1, errors.Wrapf(err, "error acquiring lock on %s", pausePidPath)
+ return false, -1, fmt.Errorf("error acquiring lock on %s: %w", pausePidPath, err)
}
pidFileLock.Lock()