Unregister events in schedulingGates plugin

Signed-off-by: kerthcet <kerthcet@gmail.com>
This commit is contained in:
kerthcet
2023-11-03 13:48:58 +08:00
parent 50f092c136
commit f77a4543d1
5 changed files with 239 additions and 5 deletions

View File

@@ -53,12 +53,10 @@ func (pl *SchedulingGates) PreEnqueue(ctx context.Context, p *v1.Pod) *framework
return framework.NewStatus(framework.UnschedulableAndUnresolvable, fmt.Sprintf("waiting for scheduling gates: %v", gates))
}
// EventsToRegister returns the possible events that may make a Pod
// failed by this plugin schedulable.
// EventsToRegister returns nil here to indicate that schedulingGates plugin is not
// interested in any event but its own update.
func (pl *SchedulingGates) EventsToRegister() []framework.ClusterEventWithHint {
return []framework.ClusterEventWithHint{
{Event: framework.ClusterEvent{Resource: framework.Pod, ActionType: framework.Update}},
}
return nil
}
// New initializes a new plugin and returns it.