Skip to content

Commit b461eca

Browse files
committed
cri: memory.memsw.limit_in_bytes: no such file or directory
If kubelet passes the swap limit (default memory limit = swap limit ), it is configured for container irrespective if the node supports swap. Signed-off-by: Qasim Sarfraz <[email protected]> (cherry picked from commit 06f18c6) Signed-off-by: Qasim Sarfraz <[email protected]>
1 parent d47069b commit b461eca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/cri/opts/spec_linux_opts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ func WithResources(resources *runtime.LinuxContainerResources, tolerateMissingHu
330330
s.Linux.Resources.Memory.Swap = &limit
331331
}
332332
}
333-
if swapLimit != 0 {
333+
if swapLimit != 0 && SwapControllerAvailable() {
334334
s.Linux.Resources.Memory.Swap = &swapLimit
335335
}
336336

0 commit comments

Comments
 (0)