Skip to content

Commit f8596d6

Browse files
committed
node: device-mgr: Change ErrorS(nil, ...) to InfoS
Ensure consistency across resource managers and update ErrorS(nil, ...) to InfoS. Similar changes have been proposed in CPU Manager and Memory Manager. Signed-off-by: Swati Sehgal <[email protected]>
1 parent a716ea7 commit f8596d6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pkg/kubelet/cm/devicemanager/manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ func (m *ManagerImpl) GetCapacity() (v1.ResourceList, v1.ResourceList, []string)
453453
// should always be consistent. Otherwise, we run with the risk
454454
// of failing to garbage collect non-existing resources or devices.
455455
if !ok {
456-
klog.ErrorS(nil, "Unexpected: healthyDevices and endpoints are out of sync")
456+
klog.InfoS("Unexpected: healthyDevices and endpoints are out of sync")
457457
}
458458
delete(m.endpoints, resourceName)
459459
delete(m.healthyDevices, resourceName)
@@ -468,7 +468,7 @@ func (m *ManagerImpl) GetCapacity() (v1.ResourceList, v1.ResourceList, []string)
468468
eI, ok := m.endpoints[resourceName]
469469
if (ok && eI.e.stopGracePeriodExpired()) || !ok {
470470
if !ok {
471-
klog.ErrorS(nil, "Unexpected: unhealthyDevices and endpoints are out of sync")
471+
klog.InfoS("Unexpected: unhealthyDevices and endpoints are out of sync")
472472
}
473473
delete(m.endpoints, resourceName)
474474
delete(m.unhealthyDevices, resourceName)
@@ -952,7 +952,7 @@ func (m *ManagerImpl) GetDeviceRunContainerOptions(pod *v1.Pod, container *v1.Co
952952
}
953953

954954
if !m.checkPodActive(pod) {
955-
klog.ErrorS(nil, "pod deleted from activePods, skip to reAllocate", "podUID", podUID)
955+
klog.InfoS("pod deleted from activePods, skip to reAllocate", "podUID", podUID)
956956
continue
957957
}
958958

pkg/kubelet/cm/devicemanager/topology_hints.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (m *ManagerImpl) GetTopologyHints(pod *v1.Pod, container *v1.Container) map
5454
allocated := m.podDevices.containerDevices(string(pod.UID), container.Name, resource)
5555
if allocated.Len() > 0 {
5656
if allocated.Len() != requested {
57-
klog.ErrorS(nil, "Resource already allocated to pod with different number than request", "resource", resource, "pod", klog.KObj(pod), "containerName", container.Name, "request", requested, "allocated", allocated.Len())
57+
klog.InfoS("Resource already allocated to pod with different number than request", "resource", resource, "pod", klog.KObj(pod), "containerName", container.Name, "request", requested, "allocated", allocated.Len())
5858
deviceHints[resource] = []topologymanager.TopologyHint{}
5959
continue
6060
}
@@ -67,7 +67,7 @@ func (m *ManagerImpl) GetTopologyHints(pod *v1.Pod, container *v1.Container) map
6767
available := m.getAvailableDevices(resource)
6868
reusable := m.devicesToReuse[string(pod.UID)][resource]
6969
if available.Union(reusable).Len() < requested {
70-
klog.ErrorS(nil, "Unable to generate topology hints: requested number of devices unavailable", "resource", resource, "request", requested, "available", available.Union(reusable).Len())
70+
klog.InfoS("Unable to generate topology hints: requested number of devices unavailable", "resource", resource, "request", requested, "available", available.Union(reusable).Len())
7171
deviceHints[resource] = []topologymanager.TopologyHint{}
7272
continue
7373
}
@@ -105,7 +105,7 @@ func (m *ManagerImpl) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymana
105105
allocated := m.podDevices.podDevices(string(pod.UID), resource)
106106
if allocated.Len() > 0 {
107107
if allocated.Len() != requested {
108-
klog.ErrorS(nil, "Resource already allocated to pod with different number than request", "resource", resource, "pod", klog.KObj(pod), "request", requested, "allocated", allocated.Len())
108+
klog.InfoS("Resource already allocated to pod with different number than request", "resource", resource, "pod", klog.KObj(pod), "request", requested, "allocated", allocated.Len())
109109
deviceHints[resource] = []topologymanager.TopologyHint{}
110110
continue
111111
}
@@ -117,7 +117,7 @@ func (m *ManagerImpl) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymana
117117
// Get the list of available devices, for which TopologyHints should be generated.
118118
available := m.getAvailableDevices(resource)
119119
if available.Len() < requested {
120-
klog.ErrorS(nil, "Unable to generate topology hints: requested number of devices unavailable", "resource", resource, "request", requested, "available", available.Len())
120+
klog.InfoS("Unable to generate topology hints: requested number of devices unavailable", "resource", resource, "request", requested, "available", available.Len())
121121
deviceHints[resource] = []topologymanager.TopologyHint{}
122122
continue
123123
}

0 commit comments

Comments
 (0)