Skip to content

Commit a89c843

Browse files
committed
node: cpumgr: ErrorS -> InfoS
Convert uncommon use of ErrorS(nil, ...) into more regular use of InfoS. Set the verbosiness level to make sure the message is still emitted in regular expected configuration. Signed-off-by: Francesco Romani <[email protected]>
1 parent bc3c070 commit a89c843

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/kubelet/cm/cpumanager/cpu_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ func (m *manager) removeStaleState() {
381381
for podUID := range assignments {
382382
for containerName := range assignments[podUID] {
383383
if _, ok := activeContainers[podUID][containerName]; !ok {
384-
klog.ErrorS(nil, "RemoveStaleState: removing container", "podUID", podUID, "containerName", containerName)
384+
klog.V(2).InfoS("RemoveStaleState: removing container", "podUID", podUID, "containerName", containerName)
385385
err := m.policyRemoveContainerByRef(podUID, containerName)
386386
if err != nil {
387387
klog.ErrorS(err, "RemoveStaleState: failed to remove container", "podUID", podUID, "containerName", containerName)
@@ -392,7 +392,7 @@ func (m *manager) removeStaleState() {
392392

393393
m.containerMap.Visit(func(podUID, containerName, containerID string) {
394394
if _, ok := activeContainers[podUID][containerName]; !ok {
395-
klog.ErrorS(nil, "RemoveStaleState: removing container", "podUID", podUID, "containerName", containerName)
395+
klog.V(2).InfoS("RemoveStaleState: removing container", "podUID", podUID, "containerName", containerName)
396396
err := m.policyRemoveContainerByRef(podUID, containerName)
397397
if err != nil {
398398
klog.ErrorS(err, "RemoveStaleState: failed to remove container", "podUID", podUID, "containerName", containerName)

pkg/kubelet/cm/cpumanager/policy_static.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ func (p *staticPolicy) GetTopologyHints(s state.State, pod *v1.Pod, container *v
515515
// kubelet restart, for example.
516516
if allocated, exists := s.GetCPUSet(string(pod.UID), container.Name); exists {
517517
if allocated.Size() != requested {
518-
klog.ErrorS(nil, "CPUs already allocated to container with different number than request", "pod", klog.KObj(pod), "containerName", container.Name, "requestedSize", requested, "allocatedSize", allocated.Size())
518+
klog.InfoS("CPUs already allocated to container with different number than request", "pod", klog.KObj(pod), "containerName", container.Name, "requestedSize", requested, "allocatedSize", allocated.Size())
519519
// An empty list of hints will be treated as a preference that cannot be satisfied.
520520
// In definition of hints this is equal to: TopologyHint[NUMANodeAffinity: nil, Preferred: false].
521521
// For all but the best-effort policy, the Topology Manager will throw a pod-admission error.
@@ -565,7 +565,7 @@ func (p *staticPolicy) GetPodTopologyHints(s state.State, pod *v1.Pod) map[strin
565565
// kubelet restart, for example.
566566
if allocated, exists := s.GetCPUSet(string(pod.UID), container.Name); exists {
567567
if allocated.Size() != requestedByContainer {
568-
klog.ErrorS(nil, "CPUs already allocated to container with different number than request", "pod", klog.KObj(pod), "containerName", container.Name, "allocatedSize", requested, "requestedByContainer", requestedByContainer, "allocatedSize", allocated.Size())
568+
klog.InfoS("CPUs already allocated to container with different number than request", "pod", klog.KObj(pod), "containerName", container.Name, "allocatedSize", requested, "requestedByContainer", requestedByContainer, "allocatedSize", allocated.Size())
569569
// An empty list of hints will be treated as a preference that cannot be satisfied.
570570
// In definition of hints this is equal to: TopologyHint[NUMANodeAffinity: nil, Preferred: false].
571571
// For all but the best-effort policy, the Topology Manager will throw a pod-admission error.

0 commit comments

Comments
 (0)