mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-16 23:29:21 +00:00
Use local isCgroup2UnifiedMode consistently
This change switches to using isCgroup2UnifiedMode locally to ensure that any mocked function is also used when checking the swap controller availability. Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
5ebb9f3195
commit
d3d1827c05
@ -320,7 +320,7 @@ func swapControllerAvailable() bool {
|
||||
swapControllerAvailabilityOnce.Do(func() {
|
||||
const warn = "Failed to detect the availability of the swap controller, assuming not available"
|
||||
p := "/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes"
|
||||
if libcontainercgroups.IsCgroup2UnifiedMode() {
|
||||
if isCgroup2UnifiedMode() {
|
||||
// memory.swap.max does not exist in the cgroup root, so we check /sys/fs/cgroup/<SELF>/memory.swap.max
|
||||
_, unified, err := cgroups.ParseCgroupFileUnified("/proc/self/cgroup")
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user