-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add checks in Create and Update Cgroup methods #28566
Add checks in Create and Update Cgroup methods #28566
Conversation
@@ -42,16 +45,40 @@ func NewCgroupManager(cs *cgroupSubsystems) CgroupManager { | |||
} | |||
} | |||
|
|||
// AlreadyExists checks if all subsystem cgroups already exist | |||
func (m *cgroupManagerImpl) AlreadyExists(name string) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Drop Already
. Just Exists
should do.
Add a fat comment explaining why the code cannot use libcontainer directly along with links to relevant issues. |
GCE e2e build/test passed for commit 422e99879a273eb30850f3e0ce4d2e1ce41a8dbc. |
422e998
to
79481d4
Compare
GCE e2e build/test passed for commit 79481d4c6522376d8d6af5a3c23c867f242f8985. |
} | ||
// If even one cgroup doesn't exist we go on to create it | ||
for _, path := range cgroupPaths { | ||
if !libcontainercgroups.PathExists(path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be moved to the range above?
79481d4
to
dcfff45
Compare
GCE e2e build/test passed for commit dcfff45. |
@jfrazelle Thanks for your comments. I ended up removing that part of the code. PTAL. |
@vishh Can we get this merged? |
@dubstack can you mention your umbrella issue in all these PRs? It will be useful for tracking. |
Done! |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit dcfff45. |
Automatic merge from submit-queue |
This PR is connected to upstream issue for adding pod level cgroups in Kubernetes: #27204
Libcontainer currently doesen't support updates to parent devices cgroups. Until we get libcontainer to support skipping devices cgroup we will have that logic on the kubelet side.
This PR includes:
On cgroupManager.Update() we only call Set() and cgroupManager.Create() we only call Apply() method
@vishh PTAL