mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
Merge pull request #108829 from kerthcet/feature/remove-unsupported-alwaysCheckAllPredicates
remove no longer supported scheduler option `runAllFilters`
This commit is contained in:
commit
80746c7622
@ -99,10 +99,6 @@ type frameworkImpl struct {
|
||||
framework.PodNominator
|
||||
|
||||
parallelizer parallelize.Parallelizer
|
||||
|
||||
// Indicates that RunFilterPlugins should accumulate all failed statuses and not return
|
||||
// after the first failure.
|
||||
runAllFilters bool
|
||||
}
|
||||
|
||||
// extensionPoint encapsulates desired and applied set of plugins at a specific extension
|
||||
@ -147,7 +143,6 @@ type frameworkOptions struct {
|
||||
metricsRecorder *metricsRecorder
|
||||
podNominator framework.PodNominator
|
||||
extenders []framework.Extender
|
||||
runAllFilters bool
|
||||
captureProfile CaptureProfile
|
||||
clusterEventMap map[framework.ClusterEvent]sets.String
|
||||
parallelizer parallelize.Parallelizer
|
||||
@ -201,14 +196,6 @@ func WithSnapshotSharedLister(snapshotSharedLister framework.SharedLister) Optio
|
||||
}
|
||||
}
|
||||
|
||||
// WithRunAllFilters sets the runAllFilters flag, which means RunFilterPlugins accumulates
|
||||
// all failure Statuses.
|
||||
func WithRunAllFilters(runAllFilters bool) Option {
|
||||
return func(o *frameworkOptions) {
|
||||
o.runAllFilters = runAllFilters
|
||||
}
|
||||
}
|
||||
|
||||
// WithPodNominator sets podNominator for the scheduling frameworkImpl.
|
||||
func WithPodNominator(nominator framework.PodNominator) Option {
|
||||
return func(o *frameworkOptions) {
|
||||
@ -274,7 +261,6 @@ func NewFramework(r Registry, profile *config.KubeSchedulerProfile, opts ...Opti
|
||||
eventRecorder: options.eventRecorder,
|
||||
informerFactory: options.informerFactory,
|
||||
metricsRecorder: options.metricsRecorder,
|
||||
runAllFilters: options.runAllFilters,
|
||||
extenders: options.extenders,
|
||||
PodNominator: options.podNominator,
|
||||
parallelizer: options.parallelizer,
|
||||
@ -695,10 +681,6 @@ func (f *frameworkImpl) RunFilterPlugins(
|
||||
}
|
||||
pluginStatus.SetFailedPlugin(pl.Name())
|
||||
statuses[pl.Name()] = pluginStatus
|
||||
if !f.runAllFilters {
|
||||
// Exit early if we don't need to run all filters.
|
||||
return statuses
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1196,7 +1196,6 @@ func TestFilterPlugins(t *testing.T) {
|
||||
plugins []*TestPlugin
|
||||
wantStatus *framework.Status
|
||||
wantStatusMap framework.PluginToStatus
|
||||
runAllFilters bool
|
||||
}{
|
||||
{
|
||||
name: "SuccessFilter",
|
||||
@ -1337,56 +1336,6 @@ func TestFilterPlugins(t *testing.T) {
|
||||
"TestPlugin2": framework.NewStatus(framework.Unschedulable, "injected filter status").WithFailedPlugin("TestPlugin2"),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "SuccessFilterWithRunAllFilters",
|
||||
plugins: []*TestPlugin{
|
||||
{
|
||||
name: "TestPlugin",
|
||||
inj: injectedResult{FilterStatus: int(framework.Success)},
|
||||
},
|
||||
},
|
||||
runAllFilters: true,
|
||||
wantStatus: nil,
|
||||
wantStatusMap: framework.PluginToStatus{},
|
||||
},
|
||||
{
|
||||
name: "ErrorAndErrorFilters",
|
||||
plugins: []*TestPlugin{
|
||||
{
|
||||
name: "TestPlugin1",
|
||||
inj: injectedResult{FilterStatus: int(framework.Error)},
|
||||
},
|
||||
|
||||
{
|
||||
name: "TestPlugin2",
|
||||
inj: injectedResult{FilterStatus: int(framework.Error)},
|
||||
},
|
||||
},
|
||||
runAllFilters: true,
|
||||
wantStatus: framework.AsStatus(fmt.Errorf(`running "TestPlugin1" filter plugin: %w`, errInjectedFilterStatus)).WithFailedPlugin("TestPlugin1"),
|
||||
wantStatusMap: framework.PluginToStatus{
|
||||
"TestPlugin1": framework.AsStatus(fmt.Errorf(`running "TestPlugin1" filter plugin: %w`, errInjectedFilterStatus)).WithFailedPlugin("TestPlugin1"),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ErrorAndErrorFilters",
|
||||
plugins: []*TestPlugin{
|
||||
{
|
||||
name: "TestPlugin1",
|
||||
inj: injectedResult{FilterStatus: int(framework.UnschedulableAndUnresolvable)},
|
||||
},
|
||||
{
|
||||
name: "TestPlugin2",
|
||||
inj: injectedResult{FilterStatus: int(framework.Unschedulable)},
|
||||
},
|
||||
},
|
||||
runAllFilters: true,
|
||||
wantStatus: framework.NewStatus(framework.UnschedulableAndUnresolvable, "injected filter status", "injected filter status").WithFailedPlugin("TestPlugin1"),
|
||||
wantStatusMap: framework.PluginToStatus{
|
||||
"TestPlugin1": framework.NewStatus(framework.UnschedulableAndUnresolvable, "injected filter status").WithFailedPlugin("TestPlugin1"),
|
||||
"TestPlugin2": framework.NewStatus(framework.Unschedulable, "injected filter status").WithFailedPlugin("TestPlugin2"),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
@ -1408,7 +1357,7 @@ func TestFilterPlugins(t *testing.T) {
|
||||
config.Plugin{Name: pl.name})
|
||||
}
|
||||
profile := config.KubeSchedulerProfile{Plugins: cfgPls}
|
||||
f, err := newFrameworkWithQueueSortAndBind(registry, profile, WithRunAllFilters(tt.runAllFilters))
|
||||
f, err := newFrameworkWithQueueSortAndBind(registry, profile)
|
||||
if err != nil {
|
||||
t.Fatalf("fail to create framework: %s", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user