From 677792663f684c3adb2d39f53c386b924b6f3c89 Mon Sep 17 00:00:00 2001 From: Kensei Nakada Date: Tue, 5 Nov 2024 12:40:09 +0900 Subject: [PATCH] fix: register Pod/Delete event at the preemption plugin --- .../plugins/defaultpreemption/default_preemption.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go b/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go index ce37a9b0af7..71e53f52009 100644 --- a/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go +++ b/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go @@ -116,7 +116,13 @@ func (pl *DefaultPreemption) PreEnqueue(ctx context.Context, p *v1.Pod) *framewo // EventsToRegister returns the possible events that may make a Pod // failed by this plugin schedulable. func (pl *DefaultPreemption) EventsToRegister(_ context.Context) ([]framework.ClusterEventWithHint, error) { - return nil, nil + return []framework.ClusterEventWithHint{ + // We don't need any QHint for the event + // because the Pod rejected by the preemption plugin is the one that is running the preemption, + // and the Pod won't be requeued until all the preemption API calls are completed + // (we block the Pod from being requeued at PreEnqueue). + {Event: framework.ClusterEvent{Resource: framework.Pod, ActionType: framework.Delete}}, + }, nil } // calculateNumCandidates returns the number of candidates the FindCandidates