Skip to content

Commit

Permalink
Fix how cgroup manager is created based on cgroups path
Browse files Browse the repository at this point in the history
Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
  • Loading branch information
YJDoc2 committed Oct 21, 2022
1 parent 497f2e6 commit 2d48e16
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/libcgroups/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ pub fn create_cgroup_manager<P: Into<PathBuf>>(
match cgroup_setup {
CgroupSetup::Legacy | CgroupSetup::Hybrid => create_v1_cgroup_manager(cgroup_path),
CgroupSetup::Unified => {
if systemd_cgroup {
return create_systemd_cgroup_manager(cgroup_path, container_name);
// ref https://github.com/opencontainers/runtime-spec/blob/main/config-linux.md#cgroups-path
if cgroup_path.is_absolute() || !systemd_cgroup {
return create_v2_cgroup_manager(cgroup_path);
}

create_v2_cgroup_manager(cgroup_path)
create_systemd_cgroup_manager(cgroup_path, container_name)
}
}
}
Expand Down

0 comments on commit 2d48e16

Please sign in to comment.