Merge pull request #123749 from iholder101/swap_log/only_once_avoid_spam

[KEP2400] Avoid logging that swap cgroup controller is missing for every container
This commit is contained in:
Kubernetes Prow Robot 2024-04-19 17:00:46 -07:00 committed by GitHub
commit 7f68d014e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -164,9 +164,9 @@ func (m *kubeGenericRuntimeManager) generateLinuxContainerResources(pod *v1.Pod,
// Swap is only configured if a swap cgroup controller is available and the NodeSwap feature gate is enabled.
func (m *kubeGenericRuntimeManager) configureContainerSwapResources(lcr *runtimeapi.LinuxContainerResources, pod *v1.Pod, container *v1.Container) {
if !swapControllerAvailable() {
klog.InfoS("No swap cgroup controller present", "swapBehavior", m.memorySwapBehavior, "pod", klog.KObj(pod), "containerName", container.Name)
return
}
swapConfigurationHelper := newSwapConfigurationHelper(*m.machineInfo)
if m.memorySwapBehavior == kubelettypes.LimitedSwap {
if !isCgroup2UnifiedMode() {