Skip to content

Commit

Permalink
Stop using --memory-swap if it is not available
Browse files Browse the repository at this point in the history
With Debian and Ubuntu kernels, it needs to be configured.

And now with cgroups v2, it starts throwing errors at run.
  • Loading branch information
afbjorklund committed Feb 18, 2021
1 parent 95dcd96 commit eabc02d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/drivers/kic/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit eabc02d

Please sign in to comment.