mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-01 09:18:45 +00:00
Merge pull request #96594 from b10s/fix-getcgroupsubsystemsv1
Fix the getCgroupSubsystemsV1() which uses only the latest record
This commit is contained in:
@@ -202,8 +202,16 @@ func getCgroupSubsystemsV1() (*CgroupSubsystems, error) {
|
||||
}
|
||||
mountPoints := make(map[string]string, len(allCgroups))
|
||||
for _, mount := range allCgroups {
|
||||
// BEFORE kubelet used a random mount point per cgroups subsystem;
|
||||
// NOW more deterministic: kubelet use mount point with shortest path;
|
||||
// FUTURE is bright with clear expectation determined in doc.
|
||||
// ref. issue: https://github.com/kubernetes/kubernetes/issues/95488
|
||||
|
||||
for _, subsystem := range mount.Subsystems {
|
||||
mountPoints[subsystem] = mount.Mountpoint
|
||||
previous := mountPoints[subsystem]
|
||||
if previous == "" || len(mount.Mountpoint) < len(previous) {
|
||||
mountPoints[subsystem] = mount.Mountpoint
|
||||
}
|
||||
}
|
||||
}
|
||||
return &CgroupSubsystems{
|
||||
|
Reference in New Issue
Block a user