diff --git a/pkg/drivers/kic/oci/oci.go b/pkg/drivers/kic/oci/oci.go index 258c62c860fb..6f1a4ad56741 100644 --- a/pkg/drivers/kic/oci/oci.go +++ b/pkg/drivers/kic/oci/oci.go @@ -113,7 +113,7 @@ func HasMemoryCgroup() bool { if runtime.GOOS == "linux" { var memory string if cgroup2, err := IsCgroup2UnifiedMode(); err == nil && cgroup2 { - memory = "/sys/fs/cgroup/memory/memsw.limit_in_bytes" + memory = "/sys/fs/cgroup/memory/memory.high" } if _, err := os.Stat(memory); os.IsNotExist(err) { klog.Warning("Your kernel does not support memory limit capabilities or the cgroup is not mounted.") @@ -193,14 +193,14 @@ func CreateContainerNode(p CreateParams) error { // podman mounts var/lib with no-exec by default https://github.com/containers/libpod/issues/5103 runArgs = append(runArgs, "--volume", fmt.Sprintf("%s:/var:exec", p.Name)) - if memcgSwap { - runArgs = append(runArgs, fmt.Sprintf("--memory-swap=%s", p.Memory)) - } - if memcg { runArgs = append(runArgs, fmt.Sprintf("--memory=%s", p.Memory)) } + if memcg && memcgSwap { + runArgs = append(runArgs, fmt.Sprintf("--memory-swap=%s", p.Memory)) + } + virtualization = "podman" // VIRTUALIZATION_PODMAN } if p.OCIBinary == Docker {