Move default binding to a plugin

Signed-off-by: Aldo Culquicondor <acondor@google.com>
This commit is contained in:
Aldo Culquicondor
2020-01-15 11:26:35 -05:00
parent dcd0755f84
commit 4a5ab84dcc
24 changed files with 563 additions and 249 deletions

View File

@@ -21,13 +21,13 @@ import (
"testing"
"github.com/google/go-cmp/cmp"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
"k8s.io/apimachinery/pkg/runtime"
utilfeature "k8s.io/apiserver/pkg/util/feature"
featuregatetesting "k8s.io/component-base/featuregate/testing"
"k8s.io/kubernetes/pkg/features"
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpodtopologyspread"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
@@ -39,6 +39,7 @@ import (
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumerestrictions"
@@ -98,6 +99,11 @@ func TestClusterAutoscalerProvider(t *testing.T) {
{Name: tainttoleration.Name, Weight: 1},
},
},
Bind: &schedulerapi.PluginSet{
Enabled: []schedulerapi.Plugin{
{Name: defaultbinder.Name},
},
},
},
FrameworkPluginConfig: []schedulerapi.PluginConfig{
{
@@ -175,6 +181,11 @@ func TestApplyFeatureGates(t *testing.T) {
{Name: tainttoleration.Name, Weight: 1},
},
},
Bind: &schedulerapi.PluginSet{
Enabled: []schedulerapi.Plugin{
{Name: defaultbinder.Name},
},
},
},
FrameworkPluginConfig: []schedulerapi.PluginConfig{
{
@@ -244,6 +255,11 @@ func TestApplyFeatureGates(t *testing.T) {
{Name: noderesources.ResourceLimitsName, Weight: 1},
},
},
Bind: &schedulerapi.PluginSet{
Enabled: []schedulerapi.Plugin{
{Name: defaultbinder.Name},
},
},
},
FrameworkPluginConfig: []schedulerapi.PluginConfig{
{