daemon: use OwnCgroupPath in withCgroups#48730
Merged
thaJeztah merged 1 commit intomoby:masterfrom Oct 23, 2024
Merged
Conversation
Note: this usage comes from commit 56f77d5 (part of PR 23430). cgroups.InitCgroupPath is removed from runc (see [1]), and it is suggested that users use OwnCgroupPath instead, because using init's is problematic when in host PID namespace (see [2]) and is generally not the right thing to do (see [3]). [1]: opencontainers/runc@fd5debf3 [2]: opencontainers/runc@2b28b3c2 [3]: opencontainers/runc@54e20217 Signed-off-by: Kir Kolyshkin <[email protected]>
Member
|
Oh! Forgot about this one, yes I ran into this one when trying updated runc vendor, but wasn't sure if removing the fallback would be OK; thanks! #47668 (comment) |
thaJeztah
approved these changes
Oct 23, 2024
| p := cgroupsPath | ||
| if useSystemd { | ||
| initPath, err := cgroups.GetInitCgroup("cpu") | ||
| path, err := cgroups.GetOwnCgroup("cpu") |
Member
There was a problem hiding this comment.
Looks like we don't currently import the "path" package, so we're good (I tend to avoid using path for variable names nowadays as it's usually waiting for a "I shadowing an import" warnings to happen)
4 tasks
This was referenced Nov 22, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
cgroups.InitCgroupPath is removed from runc (see 1), and it is suggested that users use OwnCgroupPath instead, because using init's is problematic when in host PID namespace (see 2) and is generally not the right thing to do (see 3).
Note: the code in question comes from commit 56f77d5 (part of PR #23430).
(This is included in PR #48160, and is needed to bump runc/libcontainer dependency to v1.2.0)
- How I did it
- How to verify it
Fingers crossed there are some tests in this repository.
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)