cgroup2: unshare cgroupns by default regardless to API version#41072
cgroup2: unshare cgroupns by default regardless to API version#41072cpuguy83 merged 1 commit intomoby:masterfrom
Conversation
|
ping @kolyshkin PTAL |
kolyshkin
left a comment
There was a problem hiding this comment.
Can simplify it a lot by using cgroups.IsCgroup2UnifiedMode() in place
Fix moby#41071 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
|
@kolyshkin That package only compiles on Linux and cannot be imported in |
|
Should this be in the router? If we are doing this regardless of API version, seems like the router doesn't need to know about v2. |
|
^ good point |
It's the router who resets the |
|
I don't think we should contort the router to have system level information because we can't tell if a value passed from the router is a default value or not. |
So, you are suggesting we should perform the change somewhere else. Fine, but...
...this is exactly what the problem is. We do not know if a IOW, if you don't like the way how it's currently done, can you please propose an alternative way to do the same thing? |
|
Maybe not perfect for future (albeit highly unlikely to have changes around this case), but telling the router what the default should be seems cleaner. I also opened #41129 to discuss how to handle this across the board because it is problematic in other places as well. |
|
Can we merge this PR and discuss the router design in #41129 ? |
|
I would rather not add extra compexity like this just to get the change in. |
|
Its not safe to run cgroupsv2 unnamespaced it appears, so I think we have to make this change for previous API versions. |
|
@justincormack I was curious about that. Good catch. So we can implement this totally in the daemon and not touch the API side. |
API server has |
cpuguy83
left a comment
There was a problem hiding this comment.
LGTM
It'd be nice to rework this a bit, but we need this in.
- What I did
Fix #41071
cgroup2 mode sets
cgroupns=privateby default , but the default was overridden tohostwhen API < 1.41.- How to verify it
- A picture of a cute animal (not mandatory but encouraged)
🐧