parseCgroupFromReader(): Ignore unified paths with no subsystem#3001
parseCgroupFromReader(): Ignore unified paths with no subsystem#3001thaJeztah wants to merge 1 commit into
Conversation
This ports the changes from containerd's cgroup package: containerd/cgroups@fe19473 Co-authored-by: Michael Crosby <crosbymichael@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| if subs != "" { | ||
| cgroups[subs] = parts[2] | ||
| } |
There was a problem hiding this comment.
Actually we rely on this functionality in cgroup v2, where the subsystem is empty.
There was a problem hiding this comment.
By "we" I mean not only runc itself, but also kubernetes. I was going to introduce a v2-specific function but this one does the job just fine, the only overhead is it returns a map with a a single element with empty key, rather than just a string.
More to say, this change ^^^ needs to be reverted, if you rely on ParseCgroupsFile in your v2 code. |
Yes, I'm trying to make sense of it, so the containerd/cgroups package has a runc/libcontainer/cgroups/utils.go Line 166 in 02b4b5f From your comment, I understand that both v1 and v2 cgroups can have the comma-separated format? If v2 never has a comma-separated list; should all v2 code use the variant that returns a string instead? |
Yes, this was the original implementation of it when I was working on untangling the v1/v2 mess. Had to revert this change later as a result of this discussion: #2411 (review) |
When working on containerd/cgroups#197, I noticed this change, which was not in the libcontainer variant of the same function. I thought I'd open a pull request in case this is relevant in this repository as well.
This ports the changes from containerd's cgroup package:
containerd/cgroups@fe19473 (containerd/cgroups#21)