mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-20 16:19:33 +00:00
When preemption finds no candidates, it currently makes an explicit API
call to clear the pod's nominatedNodeName in findCandidates(). However,
this is redundant because:
1. When no candidates are found, Preempt() returns a PostFilterResult with
an empty nominatedNodeName via NewPostFilterResultWithNominatedNode("")
2. This empty nominatedNodeName is propagated through the scheduling
cycle to handleSchedulingFailure()
3. handleSchedulingFailure() then properly clears the nominatedNodeName
through updatePod()
Remove the explicit ClearNominatedNodeName call in findCandidates() to
reduce unnecessary API calls while maintaining the same behavior.
This change improves performance by eliminating a duplicate API call
without changing the functional behavior of preemption.