Merge pull request #117987 from dims/update-the-cgroups-v2-toleration-in-local-up-cluster

Update the cgroups v2 toleration in local-up-cluster
This commit is contained in:
Kubernetes Prow Robot 2023-05-13 10:45:26 -07:00 committed by GitHub
commit 6ca4f541d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1086,13 +1086,14 @@ function update_packages {
}
function tolerate_cgroups_v2 {
# https://github.com/moby/moby/blob/ed89041433a031cafc0a0f19cfe573c31688d377/hack/dind#L28-L37
# https://github.com/moby/moby/blob/be220af9fb36e9baa9a75bbc41f784260aa6f96e/hack/dind#L28-L38
# cgroup v2: enable nesting
if [ -f /sys/fs/cgroup/cgroup.controllers ]; then
# move the init process (PID 1) from the root group to the /init group,
# move the processes from the root group to the /init group,
# otherwise writing subtree_control fails with EBUSY.
# An error during moving non-existent process (i.e., "cat") is ignored.
mkdir -p /sys/fs/cgroup/init
echo 1 > /sys/fs/cgroup/init/cgroup.procs
xargs -rn1 < /sys/fs/cgroup/cgroup.procs > /sys/fs/cgroup/init/cgroup.procs || :
# enable controllers
sed -e 's/ / +/g' -e 's/^/+/' < /sys/fs/cgroup/cgroup.controllers \
> /sys/fs/cgroup/cgroup.subtree_control