Commit 873ce9ca authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #45515 from derekwaynecarr/ignore-openrc

Automatic merge from submit-queue (batch tested with PRs 45515, 45579) Ignore openrc cgroup **What this PR does / why we need it**: It is a work-around for the following: https://github.com/opencontainers/runc/issues/1440 **Special notes for your reviewer**: I am open to a cleaner way to do this, but we have many developer users on Macs that ran containerized kubelets that are not able to run them right now due to the inclusion of openrc tripping up our existence checks. Ideally, runc can give us a call to say "does this exist according to what runc knows about". Or we could add a whitelist check. Right now, this was the smallest hack pending more discussion.
parents c2f6ccf0 4e002eac
...@@ -227,8 +227,20 @@ func (m *cgroupManagerImpl) Exists(name CgroupName) bool { ...@@ -227,8 +227,20 @@ func (m *cgroupManagerImpl) Exists(name CgroupName) bool {
// Get map of all cgroup paths on the system for the particular cgroup // Get map of all cgroup paths on the system for the particular cgroup
cgroupPaths := m.buildCgroupPaths(name) cgroupPaths := m.buildCgroupPaths(name)
// the presence of alternative control groups not known to runc confuses
// the kubelet existence checks.
// ideally, we would have a mechaninsm in runc to support Exists() logic
// scoped to the set control groups it understands. this is being discussed
// in https://github.com/opencontainers/runc/issues/1440
// once resolved, we can remove this code.
whitelistControllers := sets.NewString("cpu", "cpuacct", "cpuset", "memory", "hugetlb", "systemd")
// If even one cgroup path doesn't exist, then the cgroup doesn't exist. // If even one cgroup path doesn't exist, then the cgroup doesn't exist.
for _, path := range cgroupPaths { for controller, path := range cgroupPaths {
// ignore mounts we dont care about
if !whitelistControllers.Has(controller) {
continue
}
if !libcontainercgroups.PathExists(path) { if !libcontainercgroups.PathExists(path) {
return false return false
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment