From 2dc5ddd08a41a171134fd0922825ed03faa379ca Mon Sep 17 00:00:00 2001 From: Francesco Romani Date: Wed, 13 Sep 2023 11:52:50 +0200 Subject: [PATCH] node: cpumgr: logs: bump log verbosiness for expected skips In the reconciliation flow, there are expected skipping conditions (e.g. for active logs). To reduce noise in the logs, bump up the verbosiness of these messages, using odd levels. Signed-off-by: Francesco Romani --- pkg/kubelet/cm/cpumanager/cpu_manager.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/kubelet/cm/cpumanager/cpu_manager.go b/pkg/kubelet/cm/cpumanager/cpu_manager.go index 60924487b4f..2af1e731a7f 100644 --- a/pkg/kubelet/cm/cpumanager/cpu_manager.go +++ b/pkg/kubelet/cm/cpumanager/cpu_manager.go @@ -381,7 +381,7 @@ func (m *manager) removeStaleState() { for podUID := range assignments { for containerName := range assignments[podUID] { if _, ok := activeContainers[podUID][containerName]; ok { - klog.V(4).InfoS("RemoveStaleState: container still active", "podUID", podUID, "containerName", containerName) + klog.V(5).InfoS("RemoveStaleState: container still active", "podUID", podUID, "containerName", containerName) continue } klog.V(2).InfoS("RemoveStaleState: removing container", "podUID", podUID, "containerName", containerName) @@ -394,7 +394,7 @@ func (m *manager) removeStaleState() { m.containerMap.Visit(func(podUID, containerName, containerID string) { if _, ok := activeContainers[podUID][containerName]; ok { - klog.V(4).InfoS("RemoveStaleState: containerMap: container still active", "podUID", podUID, "containerName", containerName) + klog.V(5).InfoS("RemoveStaleState: containerMap: container still active", "podUID", podUID, "containerName", containerName) return } klog.V(2).InfoS("RemoveStaleState: containerMap: removing container", "podUID", podUID, "containerName", containerName) @@ -414,7 +414,7 @@ func (m *manager) reconcileState() (success []reconciledContainer, failure []rec for _, pod := range m.activePods() { pstatus, ok := m.podStatusProvider.GetPodStatus(pod.UID) if !ok { - klog.V(4).InfoS("ReconcileState: skipping pod; status not found", "pod", klog.KObj(pod)) + klog.V(5).InfoS("ReconcileState: skipping pod; status not found", "pod", klog.KObj(pod)) failure = append(failure, reconciledContainer{pod.Name, "", ""}) continue } @@ -424,14 +424,14 @@ func (m *manager) reconcileState() (success []reconciledContainer, failure []rec for _, container := range allContainers { containerID, err := findContainerIDByName(&pstatus, container.Name) if err != nil { - klog.V(4).InfoS("ReconcileState: skipping container; ID not found in pod status", "pod", klog.KObj(pod), "containerName", container.Name, "err", err) + klog.V(5).InfoS("ReconcileState: skipping container; ID not found in pod status", "pod", klog.KObj(pod), "containerName", container.Name, "err", err) failure = append(failure, reconciledContainer{pod.Name, container.Name, ""}) continue } cstatus, err := findContainerStatusByName(&pstatus, container.Name) if err != nil { - klog.V(4).InfoS("ReconcileState: skipping container; container status not found in pod status", "pod", klog.KObj(pod), "containerName", container.Name, "err", err) + klog.V(5).InfoS("ReconcileState: skipping container; container status not found in pod status", "pod", klog.KObj(pod), "containerName", container.Name, "err", err) failure = append(failure, reconciledContainer{pod.Name, container.Name, ""}) continue } @@ -474,7 +474,7 @@ func (m *manager) reconcileState() (success []reconciledContainer, failure []rec lcset := m.lastUpdateState.GetCPUSetOrDefault(string(pod.UID), container.Name) if !cset.Equals(lcset) { - klog.V(4).InfoS("ReconcileState: updating container", "pod", klog.KObj(pod), "containerName", container.Name, "containerID", containerID, "cpuSet", cset) + klog.V(5).InfoS("ReconcileState: updating container", "pod", klog.KObj(pod), "containerName", container.Name, "containerID", containerID, "cpuSet", cset) err = m.updateContainerCPUSet(ctx, containerID, cset) if err != nil { klog.ErrorS(err, "ReconcileState: failed to update container", "pod", klog.KObj(pod), "containerName", container.Name, "containerID", containerID, "cpuSet", cset)