Skip to content

Commit ad17bf0

Browse files
authored
Merge pull request kubernetes#76410 from hex108/priority
Save pod priority to avoid repeated calculation
2 parents 676fcd5 + 49832cf commit ad17bf0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/scheduler/core/generic_scheduler.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,8 +1160,9 @@ func podEligibleToPreemptOthers(pod *v1.Pod, nodeNameToInfo map[string]*schedule
11601160
nomNodeName := pod.Status.NominatedNodeName
11611161
if len(nomNodeName) > 0 {
11621162
if nodeInfo, found := nodeNameToInfo[nomNodeName]; found {
1163+
podPriority := util.GetPodPriority(pod)
11631164
for _, p := range nodeInfo.Pods() {
1164-
if p.DeletionTimestamp != nil && util.GetPodPriority(p) < util.GetPodPriority(pod) {
1165+
if p.DeletionTimestamp != nil && util.GetPodPriority(p) < podPriority {
11651166
// There is a terminating pod on the nominated node.
11661167
return false
11671168
}

0 commit comments

Comments
 (0)