Skip to content
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

fix function NodeAllocatableRoot #88970

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/kubelet/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions pkg/kubelet/cm/helpers_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you will have to change this function in other builds as well.

nodeAllocatableRoot := ParseCgroupfsToCgroupName(cgroupRoot)
if cgroupsPerQOS {
nodeAllocatableRoot = NewCgroupName(nodeAllocatableRoot, defaultNodeAllocatableCgroupName)
}
if libcontainerCgroupManagerType(cgroupDriver) == libcontainerSystemd {
return nodeAllocatableRoot.ToSystemd()
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/cm/helpers_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
}

Expand Down