mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 05:21:58 +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,
|
pod *v1.Pod,
|
||||||
nodeInfo *framework.NodeInfo,
|
nodeInfo *framework.NodeInfo,
|
||||||
pdbs []*policy.PodDisruptionBudget) ([]*v1.Pod, int, *framework.Status) {
|
pdbs []*policy.PodDisruptionBudget) ([]*v1.Pod, int, *framework.Status) {
|
||||||
|
logger := klog.FromContext(ctx)
|
||||||
var potentialVictims []*framework.PodInfo
|
var potentialVictims []*framework.PodInfo
|
||||||
removePod := func(rpi *framework.PodInfo) error {
|
removePod := func(rpi *framework.PodInfo) error {
|
||||||
if err := nodeInfo.RemovePod(rpi.Pod); err != nil {
|
if err := nodeInfo.RemovePod(rpi.Pod); err != nil {
|
||||||
@ -207,7 +208,7 @@ func (pl *DefaultPreemption) SelectVictimsOnNode(
|
|||||||
}
|
}
|
||||||
rpi := pi.Pod
|
rpi := pi.Pod
|
||||||
victims = append(victims, rpi)
|
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
|
return fits, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user