Skip to content

Commit

Permalink
cgroups: v2: always init parent dirs
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
cpuguy83 committed Jan 4, 2023
1 parent b7e3ec2 commit 0af69a6
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions crates/containerd-shim-wasm/src/sandbox/cgroups/cgroupv2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0af69a6

Please sign in to comment.