|
@@ -20,7 +20,7 @@ import (
|
|
"github.com/containerd/cgroups"
|
|
"github.com/containerd/cgroups"
|
|
statsV1 "github.com/containerd/cgroups/stats/v1"
|
|
statsV1 "github.com/containerd/cgroups/stats/v1"
|
|
statsV2 "github.com/containerd/cgroups/v2/stats"
|
|
statsV2 "github.com/containerd/cgroups/v2/stats"
|
|
- "github.com/containerd/containerd/sys"
|
|
|
|
|
|
+ "github.com/containerd/containerd/pkg/userns"
|
|
"github.com/docker/docker/api/types"
|
|
"github.com/docker/docker/api/types"
|
|
"github.com/docker/docker/api/types/blkiodev"
|
|
"github.com/docker/docker/api/types/blkiodev"
|
|
pblkiodev "github.com/docker/docker/api/types/blkiodev"
|
|
pblkiodev "github.com/docker/docker/api/types/blkiodev"
|
|
@@ -1645,7 +1645,7 @@ func setMayDetachMounts() error {
|
|
// Setting may_detach_mounts does not work in an
|
|
// Setting may_detach_mounts does not work in an
|
|
// unprivileged container. Ignore the error, but log
|
|
// unprivileged container. Ignore the error, but log
|
|
// it if we appear not to be in that situation.
|
|
// it if we appear not to be in that situation.
|
|
- if !sys.RunningInUserNS() {
|
|
|
|
|
|
+ if !userns.RunningInUserNS() {
|
|
logrus.Debugf("Permission denied writing %q to /proc/sys/fs/may_detach_mounts", "1")
|
|
logrus.Debugf("Permission denied writing %q to /proc/sys/fs/may_detach_mounts", "1")
|
|
}
|
|
}
|
|
return nil
|
|
return nil
|
|
@@ -1668,7 +1668,7 @@ func setupOOMScoreAdj(score int) error {
|
|
// Setting oom_score_adj does not work in an
|
|
// Setting oom_score_adj does not work in an
|
|
// unprivileged container. Ignore the error, but log
|
|
// unprivileged container. Ignore the error, but log
|
|
// it if we appear not to be in that situation.
|
|
// it if we appear not to be in that situation.
|
|
- if !sys.RunningInUserNS() {
|
|
|
|
|
|
+ if !userns.RunningInUserNS() {
|
|
logrus.Debugf("Permission denied writing %q to /proc/self/oom_score_adj", stringScore)
|
|
logrus.Debugf("Permission denied writing %q to /proc/self/oom_score_adj", stringScore)
|
|
}
|
|
}
|
|
return nil
|
|
return nil
|