mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-25 03:21:15 +00:00
Save pod priority to avoid repeated calculation
This commit is contained in:
parent
b8b5b1c254
commit
49832cf887
@ -1160,8 +1160,9 @@ func podEligibleToPreemptOthers(pod *v1.Pod, nodeNameToInfo map[string]*schedule
|
||||
nomNodeName := pod.Status.NominatedNodeName
|
||||
if len(nomNodeName) > 0 {
|
||||
if nodeInfo, found := nodeNameToInfo[nomNodeName]; found {
|
||||
podPriority := util.GetPodPriority(pod)
|
||||
for _, p := range nodeInfo.Pods() {
|
||||
if p.DeletionTimestamp != nil && util.GetPodPriority(p) < util.GetPodPriority(pod) {
|
||||
if p.DeletionTimestamp != nil && util.GetPodPriority(p) < podPriority {
|
||||
// There is a terminating pod on the nominated node.
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user