feature(scheduler): won't run Score if PreScore returned a Skip status (#115652)

* allow preScore to return skip status to skip running the corresponding score extension

* add test case for all skipped

* add test case for select host

* update plugin status

* skip score when all plugins are skipped

* update
This commit is contained in:
kidddddddddddddddddddddd
2023-02-14 06:53:29 +08:00
committed by GitHub
parent 436ca94642
commit f5a69ffda9
6 changed files with 355 additions and 29 deletions

View File

@@ -52,6 +52,8 @@ type CycleState struct {
recordPluginMetrics bool
// SkipFilterPlugins are plugins that will be skipped in the Filter extension point.
SkipFilterPlugins sets.Set[string]
// SkipScorePlugins are plugins that will be skipped in the Score extension point.
SkipScorePlugins sets.Set[string]
}
// NewCycleState initializes a new CycleState and returns its pointer.
@@ -88,6 +90,7 @@ func (c *CycleState) Clone() *CycleState {
})
copy.recordPluginMetrics = c.recordPluginMetrics
copy.SkipFilterPlugins = c.SkipFilterPlugins
copy.SkipScorePlugins = c.SkipScorePlugins
return copy
}