Skip to content

Commit

Permalink
Bugfix: cAdvisor machine info Clone() - clone SwapCapacity
Browse files Browse the repository at this point in the history
PR for the fix at upstream cAdvisor:
google/cadvisor#3293

Signed-off-by: Itamar Holder <[email protected]>
  • Loading branch information
iholder101 committed Apr 16, 2023
1 parent 4880d78 commit 46b0dfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/kubelet/kuberuntime/kuberuntime_container_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ func (m swapConfigurationHelper) configureLimitedSwap(lcr *runtimeapi.LinuxConta
}

func (m swapConfigurationHelper) configureUnlimitedSwap(lcr *runtimeapi.LinuxContainerResources) {
klog.Infof("configuring unlimited swap")
if m.isCgroup2UnifiedMode {
lcr.Unified[cm.Cgroup2MaxSwapFilename] = "max"
} else {
Expand All @@ -351,6 +352,7 @@ func (m swapConfigurationHelper) configureUnlimitedSwap(lcr *runtimeapi.LinuxCon
}

func (m swapConfigurationHelper) configureNoSwap(lcr *runtimeapi.LinuxContainerResources) {
klog.Infof("configuring no swap")
if m.isCgroup2UnifiedMode {
lcr.Unified[cm.Cgroup2MaxSwapFilename] = "0"
} else {
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/google/cadvisor/info/v1/machine.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 46b0dfb

Please sign in to comment.