diff --git a/pkg/drivers/kic/oci/oci.go b/pkg/drivers/kic/oci/oci.go index 27f7a49a73b1..e88f5e635e86 100644 --- a/pkg/drivers/kic/oci/oci.go +++ b/pkg/drivers/kic/oci/oci.go @@ -181,8 +181,10 @@ func CreateContainerNode(p CreateParams) error { runArgs = append(runArgs, "--security-opt", "apparmor=unconfined") runArgs = append(runArgs, fmt.Sprintf("--memory=%s", p.Memory)) - // Disable swap by setting the value to match - runArgs = append(runArgs, fmt.Sprintf("--memory-swap=%s", p.Memory)) + if memcgSwap { + // Disable swap by setting the value to match + runArgs = append(runArgs, fmt.Sprintf("--memory-swap=%s", p.Memory)) + } virtualization = "docker" // VIRTUALIZATION_DOCKER }