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
cgroups: Fix race to load cgroup.hostRoot option #27561
Conversation
d4982cd
to
0d024c9
Compare
Thanks @kvaps, the change looks great! However, it breaks the |
0d024c9
to
abf8c1e
Compare
Yeah, sorry, added it to |
abf8c1e
to
ffc0b0c
Compare
@kvaps thanks. Could you also please rebase on top of |
While loading, the package 'pkg/cgroups/manager' sets the global variable 'cgroupRoot' from the 'pkg/cgroups' package. This occurs before the configuration is fully loaded and the correct path is set in the 'pkg/cgroups' package. This variable is later used by the 'validateCgroupPath' function. As a result, the 'validateCgroupPath' function always works with the default value instead of the user-defined one. Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Sure, done |
ffc0b0c
to
ceca6e4
Compare
/test |
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.
Thanks!
While loading, the package
pkg/cgroups/manager
sets the global variablecgroupRoot
from thepkg/cgroups
package.This occurs before the configuration is fully loaded and the correct path is set in the
pkg/cgroups
package.This variable is later used by the
validateCgroupPath
function.As a result, the
validateCgroupPath
function always works with the default value instead of the user-defined one.While using
--set cgroup.autoMount.enabled=false
and--set cgroup.hostRoot=/sys/fs/cgroup
options, this might lead strange errors like:And path
/sys/fs/cgroup/kubepods
correctly existing.