Skip to content

Commit b1143da

Browse files
committed
skip unnecessary scheduling attempt when pod's finalizers change
1 parent 8f8ac98 commit b1143da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/scheduler/eventhandlers.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func responsibleForPod(pod *v1.Pod, profiles profile.Map) bool {
301301
// skipPodUpdate checks whether the specified pod update should be ignored.
302302
// This function will return true if
303303
// - The pod has already been assumed, AND
304-
// - The pod has only its ResourceVersion, Spec.NodeName and/or Annotations
304+
// - The pod has only its ResourceVersion, Spec.NodeName, Annotations, ManagedFields and/or Finalizers
305305
// updated.
306306
func (sched *Scheduler) skipPodUpdate(pod *v1.Pod) bool {
307307
// Non-assumed pods should never be skipped.
@@ -338,6 +338,8 @@ func (sched *Scheduler) skipPodUpdate(pod *v1.Pod) bool {
338338
// Same as above, when annotations are modified with ServerSideApply,
339339
// ManagedFields may also change and must be excluded
340340
p.ManagedFields = nil
341+
// Finalizers must be excluded because scheduled result can not be affected
342+
p.Finalizers = nil
341343
return p
342344
}
343345
assumedPodCopy, podCopy := f(assumedPod), f(pod)

0 commit comments

Comments
 (0)