Files
kubernetes/pkg/kubelet/cm/helpers_linux.go
b10s de60340e51 Improve the getCgroupSubsystemsV1() which uses random record per subsystem
returned by libcontainercgroups.GetCgroupMounts().

Example array from GetCgroupMounts():
```
[
        {
                Mountpoint: "/sys/fs/cgroup/systemd",
                Root: "/",
                Subsystems: []string len: 1, cap: 1, ["systemd"],},
        {
                Mountpoint: "/sys/fs/cgroup/cpu,cpuacct",
                Root: "/",
                Subsystems: []string len: 2, cap: 2, ["cpu","cpuacct"],},
        {
                Mountpoint: "/sys/fs/cgroup/systemd/some/path",
                Root: "/some/path",
                Subsystems: []string len: 1, cap: 1, ["systemd"],},
]
```
becames a map:
```
[
        "memory": "/sys/fs/cgroup/memory/kubepods",
        "systemd": "/sys/fs/cgroup/systemd/some/path",
]
```
which seems to be wrong.

Using shortest path of mountpoint per subsystem would be more reliable.

reference issue: https://github.com/kubernetes/kubernetes/issues/95488
2021-01-22 22:21:46 +09:00

9.7 KiB