simplify cgroup controller separation (#384)

master v1.1.3
Kevin Wan 4 years ago committed by GitHub
parent 8d6f6f933e
commit 744c18b7cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -92,12 +92,11 @@ func currentCgroup() (*cgroup, error) {
continue
}
if strings.Contains(subsys, ",") {
for _, k := range strings.Split(subsys, ",") {
cgroups[k] = path.Join(cgroupDir, k)
}
} else {
cgroups[subsys] = path.Join(cgroupDir, subsys)
// https://man7.org/linux/man-pages/man7/cgroups.7.html
// comma-separated list of controllers for cgroup version 1
fields := strings.Split(subsys, ",")
for _, val := range fields {
cgroups[val] = path.Join(cgroupDir, val)
}
}

Loading…
Cancel
Save