Move RunningInUserNS() to its own package
This allows using the utility without bringing whole of "sys" with it. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -41,11 +41,11 @@ import (
|
||||
oomv2 "github.com/containerd/containerd/pkg/oom/v2"
|
||||
"github.com/containerd/containerd/pkg/process"
|
||||
"github.com/containerd/containerd/pkg/stdio"
|
||||
"github.com/containerd/containerd/pkg/userns"
|
||||
"github.com/containerd/containerd/runtime/v2/runc"
|
||||
"github.com/containerd/containerd/runtime/v2/runc/options"
|
||||
"github.com/containerd/containerd/runtime/v2/shim"
|
||||
taskAPI "github.com/containerd/containerd/runtime/v2/task"
|
||||
"github.com/containerd/containerd/sys"
|
||||
"github.com/containerd/containerd/sys/reaper"
|
||||
runcC "github.com/containerd/go-runc"
|
||||
"github.com/containerd/typeurl"
|
||||
@@ -386,7 +386,7 @@ func (s *service) Start(ctx context.Context, r *taskAPI.StartRequest) (*taskAPI.
|
||||
logrus.WithError(err).Error("failed to get root controllers")
|
||||
} else {
|
||||
if err := cg.ToggleControllers(allControllers, cgroupsv2.Enable); err != nil {
|
||||
if sys.RunningInUserNS() {
|
||||
if userns.RunningInUserNS() {
|
||||
logrus.WithError(err).Debugf("failed to enable controllers (%v)", allControllers)
|
||||
} else {
|
||||
logrus.WithError(err).Errorf("failed to enable controllers (%v)", allControllers)
|
||||
|
||||
Reference in New Issue
Block a user