mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
Merge pull request #84054 from ahg-g/ahg-gp
GeneralPredicate as framework plugin config
This commit is contained in:
commit
d1a79f136b
@ -36,6 +36,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestCompatibility_v1_Scheduler(t *testing.T) {
|
func TestCompatibility_v1_Scheduler(t *testing.T) {
|
||||||
|
snapshot := scheduler.RegisteredPredicatesAndPrioritiesSnapshot()
|
||||||
|
defer scheduler.ApplyPredicatesAndPriorities(snapshot)
|
||||||
|
|
||||||
// Add serialized versions of scheduler config that exercise available options to ensure compatibility between releases
|
// Add serialized versions of scheduler config that exercise available options to ensure compatibility between releases
|
||||||
schedulerFiles := map[string]struct {
|
schedulerFiles := map[string]struct {
|
||||||
JSON string
|
JSON string
|
||||||
@ -44,6 +47,27 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
wantPlugins map[string][]kubeschedulerconfig.Plugin
|
wantPlugins map[string][]kubeschedulerconfig.Plugin
|
||||||
wantExtenders []schedulerapi.ExtenderConfig
|
wantExtenders []schedulerapi.ExtenderConfig
|
||||||
}{
|
}{
|
||||||
|
// This is a special test for the "composite" predicate "GeneralPredicate". GeneralPredicate is a combination
|
||||||
|
// of predicates, and here we test that if given, it is mapped to the set of plugins that should be executed.
|
||||||
|
"GeneralPredicate": {
|
||||||
|
JSON: `{
|
||||||
|
"kind": "Policy",
|
||||||
|
"apiVersion": "v1",
|
||||||
|
"predicates": [
|
||||||
|
{"name": "GeneralPredicates"}
|
||||||
|
],
|
||||||
|
"priorities": [
|
||||||
|
]
|
||||||
|
}`,
|
||||||
|
wantPlugins: map[string][]kubeschedulerconfig.Plugin{
|
||||||
|
"FilterPlugin": {
|
||||||
|
{Name: "NodeResources"},
|
||||||
|
{Name: "NodeName"},
|
||||||
|
{Name: "NodePorts"},
|
||||||
|
{Name: "NodeAffinity"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
// Do not change this JSON after the corresponding release has been tagged.
|
// Do not change this JSON after the corresponding release has been tagged.
|
||||||
// A failure indicates backwards compatibility with the specified release was broken.
|
// A failure indicates backwards compatibility with the specified release was broken.
|
||||||
"1.0": {
|
"1.0": {
|
||||||
@ -209,7 +233,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{"name": "MaxGCEPDVolumeCount"},
|
{"name": "MaxGCEPDVolumeCount"},
|
||||||
{"name": "MaxAzureDiskVolumeCount"},
|
{"name": "MaxAzureDiskVolumeCount"},
|
||||||
{"name": "MatchInterPodAffinity"},
|
{"name": "MatchInterPodAffinity"},
|
||||||
{"name": "GeneralPredicates"},
|
|
||||||
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
||||||
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
||||||
],"priorities": [
|
],"priorities": [
|
||||||
@ -229,7 +252,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
"MaxGCEPDVolumeCount",
|
"MaxGCEPDVolumeCount",
|
||||||
"MaxAzureDiskVolumeCount",
|
"MaxAzureDiskVolumeCount",
|
||||||
"MatchInterPodAffinity",
|
"MatchInterPodAffinity",
|
||||||
"GeneralPredicates",
|
|
||||||
"TestServiceAffinity",
|
"TestServiceAffinity",
|
||||||
"TestLabelsPresence",
|
"TestLabelsPresence",
|
||||||
),
|
),
|
||||||
@ -278,7 +300,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{"name": "MaxGCEPDVolumeCount"},
|
{"name": "MaxGCEPDVolumeCount"},
|
||||||
{"name": "MaxAzureDiskVolumeCount"},
|
{"name": "MaxAzureDiskVolumeCount"},
|
||||||
{"name": "MatchInterPodAffinity"},
|
{"name": "MatchInterPodAffinity"},
|
||||||
{"name": "GeneralPredicates"},
|
|
||||||
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
||||||
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
||||||
],"priorities": [
|
],"priorities": [
|
||||||
@ -301,7 +322,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
"MaxGCEPDVolumeCount",
|
"MaxGCEPDVolumeCount",
|
||||||
"MaxAzureDiskVolumeCount",
|
"MaxAzureDiskVolumeCount",
|
||||||
"MatchInterPodAffinity",
|
"MatchInterPodAffinity",
|
||||||
"GeneralPredicates",
|
|
||||||
"TestServiceAffinity",
|
"TestServiceAffinity",
|
||||||
"TestLabelsPresence",
|
"TestLabelsPresence",
|
||||||
),
|
),
|
||||||
@ -351,7 +371,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{"name": "MaxGCEPDVolumeCount"},
|
{"name": "MaxGCEPDVolumeCount"},
|
||||||
{"name": "MaxAzureDiskVolumeCount"},
|
{"name": "MaxAzureDiskVolumeCount"},
|
||||||
{"name": "MatchInterPodAffinity"},
|
{"name": "MatchInterPodAffinity"},
|
||||||
{"name": "GeneralPredicates"},
|
|
||||||
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
||||||
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
||||||
],"priorities": [
|
],"priorities": [
|
||||||
@ -384,7 +403,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
"MaxGCEPDVolumeCount",
|
"MaxGCEPDVolumeCount",
|
||||||
"MaxAzureDiskVolumeCount",
|
"MaxAzureDiskVolumeCount",
|
||||||
"MatchInterPodAffinity",
|
"MatchInterPodAffinity",
|
||||||
"GeneralPredicates",
|
|
||||||
"TestServiceAffinity",
|
"TestServiceAffinity",
|
||||||
"TestLabelsPresence",
|
"TestLabelsPresence",
|
||||||
),
|
),
|
||||||
@ -446,7 +464,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{"name": "MaxGCEPDVolumeCount"},
|
{"name": "MaxGCEPDVolumeCount"},
|
||||||
{"name": "MaxAzureDiskVolumeCount"},
|
{"name": "MaxAzureDiskVolumeCount"},
|
||||||
{"name": "MatchInterPodAffinity"},
|
{"name": "MatchInterPodAffinity"},
|
||||||
{"name": "GeneralPredicates"},
|
|
||||||
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
||||||
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
||||||
],"priorities": [
|
],"priorities": [
|
||||||
@ -480,7 +497,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
"MaxGCEPDVolumeCount",
|
"MaxGCEPDVolumeCount",
|
||||||
"MaxAzureDiskVolumeCount",
|
"MaxAzureDiskVolumeCount",
|
||||||
"MatchInterPodAffinity",
|
"MatchInterPodAffinity",
|
||||||
"GeneralPredicates",
|
|
||||||
"TestServiceAffinity",
|
"TestServiceAffinity",
|
||||||
"TestLabelsPresence",
|
"TestLabelsPresence",
|
||||||
),
|
),
|
||||||
@ -542,7 +558,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{"name": "MaxGCEPDVolumeCount"},
|
{"name": "MaxGCEPDVolumeCount"},
|
||||||
{"name": "MaxAzureDiskVolumeCount"},
|
{"name": "MaxAzureDiskVolumeCount"},
|
||||||
{"name": "MatchInterPodAffinity"},
|
{"name": "MatchInterPodAffinity"},
|
||||||
{"name": "GeneralPredicates"},
|
|
||||||
{"name": "CheckVolumeBinding"},
|
{"name": "CheckVolumeBinding"},
|
||||||
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
||||||
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
||||||
@ -577,7 +592,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
"MaxGCEPDVolumeCount",
|
"MaxGCEPDVolumeCount",
|
||||||
"MaxAzureDiskVolumeCount",
|
"MaxAzureDiskVolumeCount",
|
||||||
"MatchInterPodAffinity",
|
"MatchInterPodAffinity",
|
||||||
"GeneralPredicates",
|
|
||||||
"TestServiceAffinity",
|
"TestServiceAffinity",
|
||||||
"TestLabelsPresence",
|
"TestLabelsPresence",
|
||||||
),
|
),
|
||||||
@ -642,7 +656,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{"name": "MaxGCEPDVolumeCount"},
|
{"name": "MaxGCEPDVolumeCount"},
|
||||||
{"name": "MaxAzureDiskVolumeCount"},
|
{"name": "MaxAzureDiskVolumeCount"},
|
||||||
{"name": "MatchInterPodAffinity"},
|
{"name": "MatchInterPodAffinity"},
|
||||||
{"name": "GeneralPredicates"},
|
|
||||||
{"name": "CheckVolumeBinding"},
|
{"name": "CheckVolumeBinding"},
|
||||||
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
||||||
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
||||||
@ -680,7 +693,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
"MaxGCEPDVolumeCount",
|
"MaxGCEPDVolumeCount",
|
||||||
"MaxAzureDiskVolumeCount",
|
"MaxAzureDiskVolumeCount",
|
||||||
"MatchInterPodAffinity",
|
"MatchInterPodAffinity",
|
||||||
"GeneralPredicates",
|
|
||||||
"TestServiceAffinity",
|
"TestServiceAffinity",
|
||||||
"TestLabelsPresence",
|
"TestLabelsPresence",
|
||||||
),
|
),
|
||||||
@ -746,7 +758,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{"name": "MaxGCEPDVolumeCount"},
|
{"name": "MaxGCEPDVolumeCount"},
|
||||||
{"name": "MaxAzureDiskVolumeCount"},
|
{"name": "MaxAzureDiskVolumeCount"},
|
||||||
{"name": "MatchInterPodAffinity"},
|
{"name": "MatchInterPodAffinity"},
|
||||||
{"name": "GeneralPredicates"},
|
|
||||||
{"name": "CheckVolumeBinding"},
|
{"name": "CheckVolumeBinding"},
|
||||||
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
||||||
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
||||||
@ -795,7 +806,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
"MaxGCEPDVolumeCount",
|
"MaxGCEPDVolumeCount",
|
||||||
"MaxAzureDiskVolumeCount",
|
"MaxAzureDiskVolumeCount",
|
||||||
"MatchInterPodAffinity",
|
"MatchInterPodAffinity",
|
||||||
"GeneralPredicates",
|
|
||||||
"TestServiceAffinity",
|
"TestServiceAffinity",
|
||||||
"TestLabelsPresence",
|
"TestLabelsPresence",
|
||||||
),
|
),
|
||||||
@ -863,7 +873,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{"name": "MaxAzureDiskVolumeCount"},
|
{"name": "MaxAzureDiskVolumeCount"},
|
||||||
{"name": "MaxCSIVolumeCountPred"},
|
{"name": "MaxCSIVolumeCountPred"},
|
||||||
{"name": "MatchInterPodAffinity"},
|
{"name": "MatchInterPodAffinity"},
|
||||||
{"name": "GeneralPredicates"},
|
|
||||||
{"name": "CheckVolumeBinding"},
|
{"name": "CheckVolumeBinding"},
|
||||||
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
||||||
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
||||||
@ -912,7 +921,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
"MaxGCEPDVolumeCount",
|
"MaxGCEPDVolumeCount",
|
||||||
"MaxAzureDiskVolumeCount",
|
"MaxAzureDiskVolumeCount",
|
||||||
"MatchInterPodAffinity",
|
"MatchInterPodAffinity",
|
||||||
"GeneralPredicates",
|
|
||||||
"TestServiceAffinity",
|
"TestServiceAffinity",
|
||||||
"TestLabelsPresence",
|
"TestLabelsPresence",
|
||||||
),
|
),
|
||||||
@ -980,7 +988,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{"name": "MaxCSIVolumeCountPred"},
|
{"name": "MaxCSIVolumeCountPred"},
|
||||||
{"name": "MaxCinderVolumeCount"},
|
{"name": "MaxCinderVolumeCount"},
|
||||||
{"name": "MatchInterPodAffinity"},
|
{"name": "MatchInterPodAffinity"},
|
||||||
{"name": "GeneralPredicates"},
|
|
||||||
{"name": "CheckVolumeBinding"},
|
{"name": "CheckVolumeBinding"},
|
||||||
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
||||||
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
||||||
@ -1030,7 +1037,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
"MaxAzureDiskVolumeCount",
|
"MaxAzureDiskVolumeCount",
|
||||||
"MaxCinderVolumeCount",
|
"MaxCinderVolumeCount",
|
||||||
"MatchInterPodAffinity",
|
"MatchInterPodAffinity",
|
||||||
"GeneralPredicates",
|
|
||||||
"TestServiceAffinity",
|
"TestServiceAffinity",
|
||||||
"TestLabelsPresence",
|
"TestLabelsPresence",
|
||||||
),
|
),
|
||||||
@ -1098,7 +1104,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{"name": "MaxCSIVolumeCountPred"},
|
{"name": "MaxCSIVolumeCountPred"},
|
||||||
{"name": "MaxCinderVolumeCount"},
|
{"name": "MaxCinderVolumeCount"},
|
||||||
{"name": "MatchInterPodAffinity"},
|
{"name": "MatchInterPodAffinity"},
|
||||||
{"name": "GeneralPredicates"},
|
|
||||||
{"name": "CheckVolumeBinding"},
|
{"name": "CheckVolumeBinding"},
|
||||||
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
{"name": "TestServiceAffinity", "argument": {"serviceAffinity" : {"labels" : ["region"]}}},
|
||||||
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
{"name": "TestLabelsPresence", "argument": {"labelsPresence" : {"labels" : ["foo"], "presence":true}}}
|
||||||
@ -1152,7 +1157,6 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
"MaxAzureDiskVolumeCount",
|
"MaxAzureDiskVolumeCount",
|
||||||
"MaxCinderVolumeCount",
|
"MaxCinderVolumeCount",
|
||||||
"MatchInterPodAffinity",
|
"MatchInterPodAffinity",
|
||||||
"GeneralPredicates",
|
|
||||||
"TestServiceAffinity",
|
"TestServiceAffinity",
|
||||||
"TestLabelsPresence",
|
"TestLabelsPresence",
|
||||||
),
|
),
|
||||||
@ -1204,6 +1208,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
seenPredicates := sets.NewString()
|
seenPredicates := sets.NewString()
|
||||||
seenPriorities := sets.NewString()
|
seenPriorities := sets.NewString()
|
||||||
mandatoryPredicates := sets.NewString("CheckNodeCondition")
|
mandatoryPredicates := sets.NewString("CheckNodeCondition")
|
||||||
|
generalPredicateFilters := []string{"NodeResources", "NodeName", "NodePorts", "NodeAffinity"}
|
||||||
filterToPredicateMap := map[string]string{
|
filterToPredicateMap := map[string]string{
|
||||||
"TaintToleration": "PodToleratesNodeTaints",
|
"TaintToleration": "PodToleratesNodeTaints",
|
||||||
"NodeName": "HostName",
|
"NodeName": "HostName",
|
||||||
@ -1273,6 +1278,9 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
seenPredicates.Insert(filterToPredicateMap[p.Name])
|
seenPredicates.Insert(filterToPredicateMap[p.Name])
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if pluginsToStringSet(gotPlugins["FilterPlugin"]).HasAll(generalPredicateFilters...) {
|
||||||
|
seenPredicates.Insert("GeneralPredicates")
|
||||||
|
}
|
||||||
for _, p := range gotPlugins["ScorePlugin"] {
|
for _, p := range gotPlugins["ScorePlugin"] {
|
||||||
seenPriorities.Insert(scoreToPriorityMap[p.Name])
|
seenPriorities.Insert(scoreToPriorityMap[p.Name])
|
||||||
|
|
||||||
@ -1308,3 +1316,11 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
t.Errorf("Registered priorities are missing from compatibility test (add to test stanza for version currently in development): %#v", registeredPriorities.Difference(seenPriorities).List())
|
t.Errorf("Registered priorities are missing from compatibility test (add to test stanza for version currently in development): %#v", registeredPriorities.Difference(seenPriorities).List())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func pluginsToStringSet(plugins []kubeschedulerconfig.Plugin) sets.String {
|
||||||
|
s := sets.NewString()
|
||||||
|
for _, p := range plugins {
|
||||||
|
s.Insert(p.Name)
|
||||||
|
}
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
@ -646,7 +646,7 @@ func (g *genericScheduler) podFitsOnNode(
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return false, []predicates.PredicateFailureReason{}, nil, err
|
return false, []predicates.PredicateFailureReason{}, nil, err
|
||||||
}
|
}
|
||||||
} else if !podsAdded || len(failedPredicates) != 0 {
|
} else if !podsAdded || len(failedPredicates) != 0 || !status.IsSuccess() {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,6 +109,15 @@ func NewDefaultConfigProducerRegistry() *ConfigProducerRegistry {
|
|||||||
PredicateToConfigProducer: make(map[string]ConfigProducer),
|
PredicateToConfigProducer: make(map[string]ConfigProducer),
|
||||||
PriorityToConfigProducer: make(map[string]ConfigProducer),
|
PriorityToConfigProducer: make(map[string]ConfigProducer),
|
||||||
}
|
}
|
||||||
|
registry.RegisterPredicate(predicates.GeneralPred,
|
||||||
|
func(_ ConfigProducerArgs) (plugins config.Plugins, pluginConfig []config.PluginConfig) {
|
||||||
|
// GeneralPredicate is a combination of predicates.
|
||||||
|
plugins.Filter = appendToPluginSet(plugins.Filter, noderesources.Name, nil)
|
||||||
|
plugins.Filter = appendToPluginSet(plugins.Filter, nodename.Name, nil)
|
||||||
|
plugins.Filter = appendToPluginSet(plugins.Filter, nodeports.Name, nil)
|
||||||
|
plugins.Filter = appendToPluginSet(plugins.Filter, nodeaffinity.Name, nil)
|
||||||
|
return
|
||||||
|
})
|
||||||
registry.RegisterPredicate(predicates.PodToleratesNodeTaintsPred,
|
registry.RegisterPredicate(predicates.PodToleratesNodeTaintsPred,
|
||||||
func(_ ConfigProducerArgs) (plugins config.Plugins, pluginConfig []config.PluginConfig) {
|
func(_ ConfigProducerArgs) (plugins config.Plugins, pluginConfig []config.PluginConfig) {
|
||||||
plugins.Filter = appendToPluginSet(plugins.Filter, tainttoleration.Name, nil)
|
plugins.Filter = appendToPluginSet(plugins.Filter, tainttoleration.Name, nil)
|
||||||
|
@ -129,7 +129,6 @@ func TestSchedulerCreationFromConfigMap(t *testing.T) {
|
|||||||
"CheckNodeDiskPressure",
|
"CheckNodeDiskPressure",
|
||||||
"CheckNodeMemoryPressure",
|
"CheckNodeMemoryPressure",
|
||||||
"CheckNodePIDPressure",
|
"CheckNodePIDPressure",
|
||||||
"GeneralPredicates",
|
|
||||||
"MatchInterPodAffinity",
|
"MatchInterPodAffinity",
|
||||||
"MaxAzureDiskVolumeCount",
|
"MaxAzureDiskVolumeCount",
|
||||||
"MaxEBSVolumeCount",
|
"MaxEBSVolumeCount",
|
||||||
@ -143,6 +142,10 @@ func TestSchedulerCreationFromConfigMap(t *testing.T) {
|
|||||||
),
|
),
|
||||||
expectedPlugins: map[string][]kubeschedulerconfig.Plugin{
|
expectedPlugins: map[string][]kubeschedulerconfig.Plugin{
|
||||||
"FilterPlugin": {
|
"FilterPlugin": {
|
||||||
|
{Name: "NodeResources"},
|
||||||
|
{Name: "NodeName"},
|
||||||
|
{Name: "NodePorts"},
|
||||||
|
{Name: "NodeAffinity"},
|
||||||
{Name: "VolumeRestrictions"},
|
{Name: "VolumeRestrictions"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
{Name: "NodeVolumeLimits"},
|
{Name: "NodeVolumeLimits"},
|
||||||
@ -200,7 +203,6 @@ kind: Policy
|
|||||||
"CheckNodeDiskPressure",
|
"CheckNodeDiskPressure",
|
||||||
"CheckNodeMemoryPressure",
|
"CheckNodeMemoryPressure",
|
||||||
"CheckNodePIDPressure",
|
"CheckNodePIDPressure",
|
||||||
"GeneralPredicates",
|
|
||||||
"MatchInterPodAffinity",
|
"MatchInterPodAffinity",
|
||||||
"MaxAzureDiskVolumeCount",
|
"MaxAzureDiskVolumeCount",
|
||||||
"MaxEBSVolumeCount",
|
"MaxEBSVolumeCount",
|
||||||
@ -214,6 +216,10 @@ kind: Policy
|
|||||||
),
|
),
|
||||||
expectedPlugins: map[string][]kubeschedulerconfig.Plugin{
|
expectedPlugins: map[string][]kubeschedulerconfig.Plugin{
|
||||||
"FilterPlugin": {
|
"FilterPlugin": {
|
||||||
|
{Name: "NodeResources"},
|
||||||
|
{Name: "NodeName"},
|
||||||
|
{Name: "NodePorts"},
|
||||||
|
{Name: "NodeAffinity"},
|
||||||
{Name: "VolumeRestrictions"},
|
{Name: "VolumeRestrictions"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
{Name: "NodeVolumeLimits"},
|
{Name: "NodeVolumeLimits"},
|
||||||
|
Loading…
Reference in New Issue
Block a user