From 0af69a677ac9000d5649aaa54495486c8c9e4801 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Wed, 4 Jan 2023 01:29:30 +0000 Subject: [PATCH] cgroups: v2: always init parent dirs By skipping parents we were hitting an issue with the way k8s cgroups are managed since it is creating those cgroups. This change ensures we apply subtree_control to all parents as needed. Before this change pods would fail to start due to missing `cpu.weight` since we were not delegating cgroup control. Signed-off-by: Brian Goff --- crates/containerd-shim-wasm/src/sandbox/cgroups/cgroupv2.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/crates/containerd-shim-wasm/src/sandbox/cgroups/cgroupv2.rs b/crates/containerd-shim-wasm/src/sandbox/cgroups/cgroupv2.rs index fb78ee292..43aff3e1d 100644 --- a/crates/containerd-shim-wasm/src/sandbox/cgroups/cgroupv2.rs +++ b/crates/containerd-shim-wasm/src/sandbox/cgroups/cgroupv2.rs @@ -38,12 +38,6 @@ impl CgroupV2 { for d in p.iter() { full = safe_join(full.clone(), PathBuf::from(d))?; - if full.exists() { - debug!("skipping creation of existing cgroup: {}", full.display()); - // This is a pre-existing cgroup, so we won't touch subtree control. - continue; - } - if full.to_str() == self.full_path()?.to_str() { // This is the last element in the path, so we don't need to create it. // The cgroup will get created later when we try to write to a file in it.