mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-02 02:21:22 +00:00
Fix a regression that scheduler always go through all Filter plugins
The correct behavior is to stop upon the first Filter failure.
This commit is contained in:
@@ -1506,7 +1506,6 @@ func TestFilterPlugins(t *testing.T) {
|
||||
name: "TestPlugin1",
|
||||
inj: injectedResult{FilterStatus: int(framework.Error)},
|
||||
},
|
||||
|
||||
{
|
||||
name: "TestPlugin2",
|
||||
inj: injectedResult{FilterStatus: int(framework.Error)},
|
||||
@@ -1517,6 +1516,23 @@ func TestFilterPlugins(t *testing.T) {
|
||||
"TestPlugin1": framework.AsStatus(fmt.Errorf(`running "TestPlugin1" filter plugin: %w`, errInjectedFilterStatus)).WithFailedPlugin("TestPlugin1"),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "UnschedulableAndUnschedulableFilters",
|
||||
plugins: []*TestPlugin{
|
||||
{
|
||||
name: "TestPlugin1",
|
||||
inj: injectedResult{FilterStatus: int(framework.Unschedulable)},
|
||||
},
|
||||
{
|
||||
name: "TestPlugin2",
|
||||
inj: injectedResult{FilterStatus: int(framework.Unschedulable)},
|
||||
},
|
||||
},
|
||||
wantStatus: framework.NewStatus(framework.Unschedulable, injectFilterReason).WithFailedPlugin("TestPlugin1"),
|
||||
wantStatusMap: framework.PluginToStatus{
|
||||
"TestPlugin1": framework.NewStatus(framework.Unschedulable, injectFilterReason).WithFailedPlugin("TestPlugin1"),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "SuccessAndSuccessFilters",
|
||||
plugins: []*TestPlugin{
|
||||
|
||||
Reference in New Issue
Block a user