Skip to content

Commit 1714fbf

Browse files
committed
node: memory-mgr: Change ErrorS(nil, ...) to InfoS
Ensure consistency across resource managers and update ErrorS(nil, ...) to InfoS. Signed-off-by: Swati Sehgal <[email protected]>
1 parent 2d0a4f7 commit 1714fbf

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

pkg/kubelet/cm/memorymanager/policy_static.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -304,18 +304,18 @@ func regenerateHints(pod *v1.Pod, ctn *v1.Container, ctnBlocks []state.Block, re
304304
}
305305

306306
if len(ctnBlocks) != len(reqRsrc) {
307-
klog.ErrorS(nil, "The number of requested resources by the container differs from the number of memory blocks", "containerName", ctn.Name)
307+
klog.InfoS("The number of requested resources by the container differs from the number of memory blocks", "containerName", ctn.Name)
308308
return nil
309309
}
310310

311311
for _, b := range ctnBlocks {
312312
if _, ok := reqRsrc[b.Type]; !ok {
313-
klog.ErrorS(nil, "Container requested resources do not have resource of this type", "containerName", ctn.Name, "type", b.Type)
313+
klog.InfoS("Container requested resources do not have resource of this type", "containerName", ctn.Name, "type", b.Type)
314314
return nil
315315
}
316316

317317
if b.Size != reqRsrc[b.Type] {
318-
klog.ErrorS(nil, "Memory already allocated with different numbers than requested", "podUID", pod.UID, "type", b.Type, "containerName", ctn.Name, "requestedResource", reqRsrc[b.Type], "allocatedSize", b.Size)
318+
klog.InfoS("Memory already allocated with different numbers than requested", "podUID", pod.UID, "type", b.Type, "containerName", ctn.Name, "requestedResource", reqRsrc[b.Type], "allocatedSize", b.Size)
319319
return nil
320320
}
321321

@@ -654,36 +654,36 @@ func (p *staticPolicy) validateState(s state.State) error {
654654

655655
func areMachineStatesEqual(ms1, ms2 state.NUMANodeMap) bool {
656656
if len(ms1) != len(ms2) {
657-
klog.ErrorS(nil, "Node states are different", "lengthNode1", len(ms1), "lengthNode2", len(ms2))
657+
klog.InfoS("Node states are different", "lengthNode1", len(ms1), "lengthNode2", len(ms2))
658658
return false
659659
}
660660

661661
for nodeID, nodeState1 := range ms1 {
662662
nodeState2, ok := ms2[nodeID]
663663
if !ok {
664-
klog.ErrorS(nil, "Node state does not have node ID", "nodeID", nodeID)
664+
klog.InfoS("Node state does not have node ID", "nodeID", nodeID)
665665
return false
666666
}
667667

668668
if nodeState1.NumberOfAssignments != nodeState2.NumberOfAssignments {
669-
klog.ErrorS(nil, "Node states number of assignments are different", "assignment1", nodeState1.NumberOfAssignments, "assignment2", nodeState2.NumberOfAssignments)
669+
klog.InfoS("Node states number of assignments are different", "assignment1", nodeState1.NumberOfAssignments, "assignment2", nodeState2.NumberOfAssignments)
670670
return false
671671
}
672672

673673
if !areGroupsEqual(nodeState1.Cells, nodeState2.Cells) {
674-
klog.ErrorS(nil, "Node states groups are different", "stateNode1", nodeState1.Cells, "stateNode2", nodeState2.Cells)
674+
klog.InfoS("Node states groups are different", "stateNode1", nodeState1.Cells, "stateNode2", nodeState2.Cells)
675675
return false
676676
}
677677

678678
if len(nodeState1.MemoryMap) != len(nodeState2.MemoryMap) {
679-
klog.ErrorS(nil, "Node states memory map have different lengths", "lengthNode1", len(nodeState1.MemoryMap), "lengthNode2", len(nodeState2.MemoryMap))
679+
klog.InfoS("Node states memory map have different lengths", "lengthNode1", len(nodeState1.MemoryMap), "lengthNode2", len(nodeState2.MemoryMap))
680680
return false
681681
}
682682

683683
for resourceName, memoryState1 := range nodeState1.MemoryMap {
684684
memoryState2, ok := nodeState2.MemoryMap[resourceName]
685685
if !ok {
686-
klog.ErrorS(nil, "Memory state does not have resource", "resource", resourceName)
686+
klog.InfoS("Memory state does not have resource", "resource", resourceName)
687687
return false
688688
}
689689

@@ -715,17 +715,17 @@ func areMachineStatesEqual(ms1, ms2 state.NUMANodeMap) bool {
715715

716716
func areMemoryStatesEqual(memoryState1, memoryState2 *state.MemoryTable, nodeID int, resourceName v1.ResourceName) bool {
717717
if memoryState1.TotalMemSize != memoryState2.TotalMemSize {
718-
klog.ErrorS(nil, "Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "TotalMemSize", "TotalMemSize1", memoryState1.TotalMemSize, "TotalMemSize2", memoryState2.TotalMemSize, "memoryState1", *memoryState1, "memoryState2", *memoryState2)
718+
klog.InfoS("Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "TotalMemSize", "TotalMemSize1", memoryState1.TotalMemSize, "TotalMemSize2", memoryState2.TotalMemSize, "memoryState1", *memoryState1, "memoryState2", *memoryState2)
719719
return false
720720
}
721721

722722
if memoryState1.SystemReserved != memoryState2.SystemReserved {
723-
klog.ErrorS(nil, "Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "SystemReserved", "SystemReserved1", memoryState1.SystemReserved, "SystemReserved2", memoryState2.SystemReserved, "memoryState1", *memoryState1, "memoryState2", *memoryState2)
723+
klog.InfoS("Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "SystemReserved", "SystemReserved1", memoryState1.SystemReserved, "SystemReserved2", memoryState2.SystemReserved, "memoryState1", *memoryState1, "memoryState2", *memoryState2)
724724
return false
725725
}
726726

727727
if memoryState1.Allocatable != memoryState2.Allocatable {
728-
klog.ErrorS(nil, "Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "Allocatable", "Allocatable1", memoryState1.Allocatable, "Allocatable2", memoryState2.Allocatable, "memoryState1", *memoryState1, "memoryState2", *memoryState2)
728+
klog.InfoS("Memory states for the NUMA node and resource are different", "node", nodeID, "resource", resourceName, "field", "Allocatable", "Allocatable1", memoryState1.Allocatable, "Allocatable2", memoryState2.Allocatable, "memoryState1", *memoryState1, "memoryState2", *memoryState2)
729729
return false
730730
}
731731
return true

0 commit comments

Comments
 (0)