summaryrefslogtreecommitdiff
path: root/utils/utils_supported.go
diff options
context:
space:
mode:
authorSascha Grunert <sgrunert@redhat.com>2022-07-05 12:13:31 +0200
committerSascha Grunert <sgrunert@redhat.com>2022-07-05 12:13:33 +0200
commit49cb288df3224da71556e27d2e73e06d446c61f2 (patch)
tree7a69d9bbc60eb067f0e39d275648e10d577d5f22 /utils/utils_supported.go
parent773eead54e2e0877e92d5871625a6cc32c582d30 (diff)
downloadpodman-49cb288df3224da71556e27d2e73e06d446c61f2.tar.gz
podman-49cb288df3224da71556e27d2e73e06d446c61f2.tar.bz2
podman-49cb288df3224da71556e27d2e73e06d446c61f2.zip
hack/test/utils: 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 'utils/utils_supported.go')
-rw-r--r--utils/utils_supported.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/utils/utils_supported.go b/utils/utils_supported.go
index 6378212b6..d7d47b2bc 100644
--- a/utils/utils_supported.go
+++ b/utils/utils_supported.go
@@ -17,7 +17,6 @@ import (
"github.com/containers/podman/v4/pkg/rootless"
systemdDbus "github.com/coreos/go-systemd/v22/dbus"
"github.com/godbus/dbus/v5"
- "github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
@@ -77,7 +76,7 @@ func getCgroupProcess(procFile string, allowRoot bool) (string, error) {
line := scanner.Text()
parts := strings.SplitN(line, ":", 3)
if len(parts) != 3 {
- return "", errors.Errorf("cannot parse cgroup line %q", line)
+ return "", fmt.Errorf("cannot parse cgroup line %q", line)
}
if strings.HasPrefix(line, "0::") {
cgroup = line[3:]
@@ -88,7 +87,7 @@ func getCgroupProcess(procFile string, allowRoot bool) (string, error) {
}
}
if len(cgroup) == 0 || (!allowRoot && cgroup == "/") {
- return "", errors.Errorf("could not find cgroup mount in %q", procFile)
+ return "", fmt.Errorf("could not find cgroup mount in %q", procFile)
}
return cgroup, nil
}
@@ -133,7 +132,7 @@ func moveUnderCgroup(cgroup, subtree string, processes []uint32) error {
line := scanner.Text()
parts := strings.SplitN(line, ":", 3)
if len(parts) != 3 {
- return errors.Errorf("cannot parse cgroup line %q", line)
+ return fmt.Errorf("cannot parse cgroup line %q", line)
}
// root cgroup, skip it