Merge pull request #8857 from mqasimsarfraz/qasim/fix-swap-limit

cri: memory.memsw.limit_in_bytes: no such file or directory
This commit is contained in:
Fu Wei 2023-07-24 09:54:52 +08:00 committed by GitHub
commit e587e45044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -329,7 +329,7 @@ func WithResources(resources *runtime.LinuxContainerResources, tolerateMissingHu
s.Linux.Resources.Memory.Swap = &limit
}
}
if swapLimit != 0 {
if swapLimit != 0 && SwapControllerAvailable() {
s.Linux.Resources.Memory.Swap = &swapLimit
}