Merge pull request #6200 from haircommander/skip-unified

cgroup: skip unified if we are using v1
This commit is contained in:
OpenShift Merge Robot
2020-05-13 03:23:11 -07:00
committed by GitHub

View File

@ -517,6 +517,10 @@ func (c *CgroupControl) AddPid(pid int) error {
}
for _, n := range names {
// If we aren't using cgroup2, we won't write correctly to unified hierarchy
if !c.cgroup2 && n == "unified" {
continue
}
p := filepath.Join(c.getCgroupv1Path(n), "tasks")
if err := ioutil.WriteFile(p, pidString, 0644); err != nil {
return errors.Wrapf(err, "write %s", p)