mirror of https://github.com/k3s-io/k3s
Don't evacuate the root cgroup when rootless
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>pull/4106/head
parent
3615e94d68
commit
27bebd11a5
|
@ -7,6 +7,7 @@ import (
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
"github.com/containerd/containerd/sys"
|
||||||
"github.com/erikdubbelboer/gspt"
|
"github.com/erikdubbelboer/gspt"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/rancher/k3s/pkg/version"
|
"github.com/rancher/k3s/pkg/version"
|
||||||
|
@ -20,10 +21,12 @@ func HandleInit() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// The root cgroup has to be empty to enable subtree_control, so evacuate it by placing
|
if !sys.RunningInUserNS() {
|
||||||
// ourselves in the init cgroup.
|
// The root cgroup has to be empty to enable subtree_control, so evacuate it by placing
|
||||||
if err := cgrouputil.EvacuateCgroup2("init"); err != nil {
|
// ourselves in the init cgroup.
|
||||||
return errors.Wrap(err, "failed to evacuate root cgroup")
|
if err := cgrouputil.EvacuateCgroup2("init"); err != nil {
|
||||||
|
return errors.Wrap(err, "failed to evacuate root cgroup")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pwd, err := os.Getwd()
|
pwd, err := os.Getwd()
|
||||||
|
|
Loading…
Reference in New Issue