mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #76410 from hex108/priority
Save pod priority to avoid repeated calculation
This commit is contained in:
commit
ad17bf05d9
@ -1160,8 +1160,9 @@ func podEligibleToPreemptOthers(pod *v1.Pod, nodeNameToInfo map[string]*schedule
|
|||||||
nomNodeName := pod.Status.NominatedNodeName
|
nomNodeName := pod.Status.NominatedNodeName
|
||||||
if len(nomNodeName) > 0 {
|
if len(nomNodeName) > 0 {
|
||||||
if nodeInfo, found := nodeNameToInfo[nomNodeName]; found {
|
if nodeInfo, found := nodeNameToInfo[nomNodeName]; found {
|
||||||
|
podPriority := util.GetPodPriority(pod)
|
||||||
for _, p := range nodeInfo.Pods() {
|
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.
|
// There is a terminating pod on the nominated node.
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user