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

@@ -629,12 +629,12 @@ type defaultEnqueueExtension struct {
}
func (p *defaultEnqueueExtension) Name() string { return p.pluginName }
func (p *defaultEnqueueExtension) EventsToRegister() []framework.ClusterEventWithHint {
func (p *defaultEnqueueExtension) EventsToRegister(_ context.Context) ([]framework.ClusterEventWithHint, error) {
// need to return all specific cluster events with framework.All action instead of wildcard event
// because the returning values are used to register event handlers.
// If we return the wildcard here, it won't affect the event handlers registered by the plugin
// and some events may not be registered in the event handlers.
return framework.UnrollWildCardResource()
return framework.UnrollWildCardResource(), nil
}
func updatePluginList(pluginList interface{}, pluginSet config.PluginSet, pluginsMap map[string]framework.Plugin) error {