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 var cgroupRoots []string
nodeAllocatableRoot := cm.NodeAllocatableRoot(s.CgroupRoot, s.CgroupsPerQOS, s.CgroupDriver)
cgroupRoots = append(cgroupRoots, cm.NodeAllocatableRoot(s.CgroupRoot, s.CgroupDriver)) cgroupRoots = append(cgroupRoots, nodeAllocatableRoot)
kubeletCgroup, err := cm.GetKubeletContainer(s.KubeletCgroups) kubeletCgroup, err := cm.GetKubeletContainer(s.KubeletCgroups)
if err != nil { if err != nil {
klog.Warningf("failed to get the kubelet's cgroup: %v. Kubelet system container metrics may be missing.", err) 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 // 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 {
root := ParseCgroupfsToCgroupName(cgroupRoot) nodeAllocatableRoot := ParseCgroupfsToCgroupName(cgroupRoot)
nodeAllocatableRoot := NewCgroupName(root, defaultNodeAllocatableCgroupName) if cgroupsPerQOS {
nodeAllocatableRoot = NewCgroupName(nodeAllocatableRoot, defaultNodeAllocatableCgroupName)
}
if libcontainerCgroupManagerType(cgroupDriver) == libcontainerSystemd { if libcontainerCgroupManagerType(cgroupDriver) == libcontainerSystemd {
return nodeAllocatableRoot.ToSystemd() 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 // 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 "" return ""
} }