scheduler: Add ctx param and error return to EnqueueExtensions.EventsToRegister()

This commit is contained in:
googs1025
2024-07-16 13:47:31 +08:00
parent ff78057631
commit a3978e8315
24 changed files with 122 additions and 66 deletions

View File

@@ -429,9 +429,9 @@ func (pl *dynamicResources) Name() string {
// EventsToRegister returns the possible events that may make a Pod
// failed by this plugin schedulable.
func (pl *dynamicResources) EventsToRegister() []framework.ClusterEventWithHint {
func (pl *dynamicResources) EventsToRegister(_ context.Context) ([]framework.ClusterEventWithHint, error) {
if !pl.enabled {
return nil
return nil, nil
}
events := []framework.ClusterEventWithHint{
@@ -460,7 +460,7 @@ func (pl *dynamicResources) EventsToRegister() []framework.ClusterEventWithHint
// A pod might be waiting for a class to get created or modified.
{Event: framework.ClusterEvent{Resource: framework.ResourceClass, ActionType: framework.Add | framework.Update}},
}
return events
return events, nil
}
// PreEnqueue checks if there are known reasons why a pod currently cannot be