mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Migrate pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go to use contextual logging
This commit is contained in:
parent
eeb1399383
commit
37a9260d5c
@ -142,6 +142,7 @@ func (pl *DefaultPreemption) SelectVictimsOnNode(
|
||||
pod *v1.Pod,
|
||||
nodeInfo *framework.NodeInfo,
|
||||
pdbs []*policy.PodDisruptionBudget) ([]*v1.Pod, int, *framework.Status) {
|
||||
logger := klog.FromContext(ctx)
|
||||
var potentialVictims []*framework.PodInfo
|
||||
removePod := func(rpi *framework.PodInfo) error {
|
||||
if err := nodeInfo.RemovePod(rpi.Pod); err != nil {
|
||||
@ -207,7 +208,7 @@ func (pl *DefaultPreemption) SelectVictimsOnNode(
|
||||
}
|
||||
rpi := pi.Pod
|
||||
victims = append(victims, rpi)
|
||||
klog.V(5).InfoS("Pod is a potential preemption victim on node", "pod", klog.KObj(rpi), "node", klog.KObj(nodeInfo.Node()))
|
||||
logger.V(5).Info("Pod is a potential preemption victim on node", "pod", klog.KObj(rpi), "node", klog.KObj(nodeInfo.Node()))
|
||||
}
|
||||
return fits, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user