mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-16 06:32:32 +00:00
Added the first predicate as a filter plugin: PodToleratesNodeTaints.
This commit is contained in:
@@ -66,6 +66,7 @@ go_test(
|
||||
"//test/integration/framework:go_default_library",
|
||||
"//test/utils:go_default_library",
|
||||
"//test/utils/image:go_default_library",
|
||||
"//vendor/github.com/google/go-cmp/cmp:go_default_library",
|
||||
"//vendor/k8s.io/klog:go_default_library",
|
||||
],
|
||||
)
|
||||
|
@@ -899,7 +899,8 @@ func TestBindPlugin(t *testing.T) {
|
||||
context := initTestSchedulerWithOptions(t, testContext, false, nil, time.Second,
|
||||
scheduler.WithFrameworkPlugins(plugins),
|
||||
scheduler.WithFrameworkPluginConfig(pluginConfig),
|
||||
scheduler.WithFrameworkRegistry(registry))
|
||||
scheduler.WithFrameworkRegistry(registry),
|
||||
scheduler.WithFrameworkConfigProducerRegistry(nil))
|
||||
defer cleanupTest(t, context)
|
||||
|
||||
// Add a few nodes.
|
||||
|
@@ -23,6 +23,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/api/resource"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -93,6 +95,7 @@ func TestSchedulerCreationFromConfigMap(t *testing.T) {
|
||||
policy string
|
||||
expectedPredicates sets.String
|
||||
expectedPrioritizers sets.String
|
||||
expectedPlugins map[string][]string
|
||||
}{
|
||||
{
|
||||
policy: `{
|
||||
@@ -136,7 +139,6 @@ func TestSchedulerCreationFromConfigMap(t *testing.T) {
|
||||
"MaxGCEPDVolumeCount",
|
||||
"NoDiskConflict",
|
||||
"NoVolumeZoneConflict",
|
||||
"PodToleratesNodeTaints",
|
||||
),
|
||||
expectedPrioritizers: sets.NewString(
|
||||
"BalancedResourceAllocation",
|
||||
@@ -148,6 +150,9 @@ func TestSchedulerCreationFromConfigMap(t *testing.T) {
|
||||
"TaintTolerationPriority",
|
||||
"ImageLocalityPriority",
|
||||
),
|
||||
expectedPlugins: map[string][]string{
|
||||
"FilterPlugin": {"TaintToleration"},
|
||||
},
|
||||
},
|
||||
{
|
||||
policy: `{
|
||||
@@ -201,7 +206,6 @@ kind: Policy
|
||||
"MaxGCEPDVolumeCount",
|
||||
"NoDiskConflict",
|
||||
"NoVolumeZoneConflict",
|
||||
"PodToleratesNodeTaints",
|
||||
),
|
||||
expectedPrioritizers: sets.NewString(
|
||||
"BalancedResourceAllocation",
|
||||
@@ -213,6 +217,9 @@ kind: Policy
|
||||
"TaintTolerationPriority",
|
||||
"ImageLocalityPriority",
|
||||
),
|
||||
expectedPlugins: map[string][]string{
|
||||
"FilterPlugin": {"TaintToleration"},
|
||||
},
|
||||
},
|
||||
{
|
||||
policy: `apiVersion: v1
|
||||
@@ -287,6 +294,10 @@ priorities: []
|
||||
if !schedPrioritizers.Equal(test.expectedPrioritizers) {
|
||||
t.Errorf("Expected priority functions %v, got %v", test.expectedPrioritizers, schedPrioritizers)
|
||||
}
|
||||
schedPlugins := sched.Framework.ListPlugins()
|
||||
if diff := cmp.Diff(test.expectedPlugins, schedPlugins); diff != "" {
|
||||
t.Errorf("unexpected predicates diff (-want, +got): %s", diff)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user