mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 12:32:03 +00:00
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:
commit
7f68d014e5
@ -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.
|
// 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) {
|
func (m *kubeGenericRuntimeManager) configureContainerSwapResources(lcr *runtimeapi.LinuxContainerResources, pod *v1.Pod, container *v1.Container) {
|
||||||
if !swapControllerAvailable() {
|
if !swapControllerAvailable() {
|
||||||
klog.InfoS("No swap cgroup controller present", "swapBehavior", m.memorySwapBehavior, "pod", klog.KObj(pod), "containerName", container.Name)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
swapConfigurationHelper := newSwapConfigurationHelper(*m.machineInfo)
|
swapConfigurationHelper := newSwapConfigurationHelper(*m.machineInfo)
|
||||||
if m.memorySwapBehavior == kubelettypes.LimitedSwap {
|
if m.memorySwapBehavior == kubelettypes.LimitedSwap {
|
||||||
if !isCgroup2UnifiedMode() {
|
if !isCgroup2UnifiedMode() {
|
||||||
|
Loading…
Reference in New Issue
Block a user