Merge pull request #88970 from mysunshine92/correct-NodeAllocatableRoot

fix function NodeAllocatableRoot
This commit is contained in:
Kubernetes Prow Robot 2020-04-14 11:04:13 -07:00 committed by GitHub
commit 105c0c6951
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View File

@ -608,8 +608,8 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies, featureGate f
}
var cgroupRoots []string
cgroupRoots = append(cgroupRoots, cm.NodeAllocatableRoot(s.CgroupRoot, s.CgroupDriver))
nodeAllocatableRoot := cm.NodeAllocatableRoot(s.CgroupRoot, s.CgroupsPerQOS, s.CgroupDriver)
cgroupRoots = append(cgroupRoots, nodeAllocatableRoot)
kubeletCgroup, err := cm.GetKubeletContainer(s.KubeletCgroups)
if err != nil {
klog.Warningf("failed to get the kubelet's cgroup: %v. Kubelet system container metrics may be missing.", err)

View File

@ -276,9 +276,11 @@ func GetPodCgroupNameSuffix(podUID types.UID) string {
}
// NodeAllocatableRoot returns the literal cgroup path for the node allocatable cgroup
func NodeAllocatableRoot(cgroupRoot, cgroupDriver string) string {
root := ParseCgroupfsToCgroupName(cgroupRoot)
nodeAllocatableRoot := NewCgroupName(root, defaultNodeAllocatableCgroupName)
func NodeAllocatableRoot(cgroupRoot string, cgroupsPerQOS bool, cgroupDriver string) string {
nodeAllocatableRoot := ParseCgroupfsToCgroupName(cgroupRoot)
if cgroupsPerQOS {
nodeAllocatableRoot = NewCgroupName(nodeAllocatableRoot, defaultNodeAllocatableCgroupName)
}
if libcontainerCgroupManagerType(cgroupDriver) == libcontainerSystemd {
return nodeAllocatableRoot.ToSystemd()
}

View File

@ -61,7 +61,7 @@ func GetPodCgroupNameSuffix(podUID types.UID) string {
}
// NodeAllocatableRoot returns the literal cgroup path for the node allocatable cgroup
func NodeAllocatableRoot(cgroupRoot, cgroupDriver string) string {
func NodeAllocatableRoot(cgroupRoot string, cgroupsPerQOS bool, cgroupDriver string) string {
return ""
}