Skip to content

Commit

Permalink
Remove duplicate log fields
Browse files Browse the repository at this point in the history
Signed-off-by: learner0810 <[email protected]>
  • Loading branch information
learner0810 authored and wawa0210 committed Feb 11, 2025
1 parent 1f6dfc2 commit defb84c
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions pkg/scheduler/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,13 @@ func (m *podManager) addPod(pod *corev1.Pod, nodeID string, devices util.PodDevi
m.pods[pod.UID] = pi
klog.InfoS("Pod added",
"pod", klog.KRef(pod.Namespace, pod.Name),
"namespace", pod.Namespace,
"name", pod.Name,
"nodeID", nodeID,
"devices", devices,
)
} else {
m.pods[pod.UID].Devices = devices
klog.InfoS("Pod devices updated",
"pod", klog.KRef(pod.Namespace, pod.Name),
"namespace", pod.Namespace,
"name", pod.Name,
"devices", devices,
)
}
Expand All @@ -92,16 +88,12 @@ func (m *podManager) delPod(pod *corev1.Pod) {
if exists {
klog.InfoS("Pod deleted",
"pod", klog.KRef(pod.Namespace, pod.Name),
"namespace", pod.Namespace,
"name", pod.Name,
"nodeID", pi.NodeID,
)
delete(m.pods, pod.UID)
} else {
klog.InfoS("Pod not found for deletion",
"pod", klog.KRef(pod.Namespace, pod.Name),
"namespace", pod.Namespace,
"name", pod.Name,
)
}
}
Expand Down Expand Up @@ -129,14 +121,12 @@ func (m *podManager) ListPodsInfo() []*podInfo {
defer m.mutex.RUnlock()

pods := make([]*podInfo, 0, len(m.pods))
for _, pi := range m.pods {
pods = append(pods, pi)
for _, pod := range m.pods {
pods = append(pods, pod)
klog.InfoS("Pod info",
"pod", klog.KRef(pi.Namespace, pi.Name),
"namespace", pi.Namespace,
"name", pi.Name,
"nodeID", pi.NodeID,
"devices", pi.Devices,
"pod", klog.KRef(pod.Namespace, pod.Name),
"nodeID", pod.NodeID,
"devices", pod.Devices,
)
}
klog.V(5).InfoS("Listed pod infos",
Expand Down

0 comments on commit defb84c

Please sign in to comment.