mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Remove priority execution paths in favor of score plugins
Mainly affects core/generic_scheduler.go (and related tests). Removes the "prioritizers" field and related functions.
This commit is contained in:
@@ -167,9 +167,7 @@ func (es mockScheduler) Schedule(ctx context.Context, state *framework.CycleStat
|
||||
func (es mockScheduler) Predicates() map[string]predicates.FitPredicate {
|
||||
return nil
|
||||
}
|
||||
func (es mockScheduler) Prioritizers() []priorities.PriorityConfig {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (es mockScheduler) Extenders() []algorithm.SchedulerExtender {
|
||||
return nil
|
||||
}
|
||||
@@ -690,7 +688,6 @@ func setupTestScheduler(queuedPodStore *clientcache.FIFO, scache internalcache.C
|
||||
internalqueue.NewSchedulingQueue(nil),
|
||||
nil,
|
||||
predicates.EmptyMetadataProducer,
|
||||
[]priorities.PriorityConfig{},
|
||||
priorities.EmptyMetadataProducer,
|
||||
nodeinfosnapshot.NewEmptySnapshot(),
|
||||
fwk,
|
||||
@@ -749,7 +746,6 @@ func setupTestSchedulerLongBindingWithRetry(queuedPodStore *clientcache.FIFO, sc
|
||||
queue,
|
||||
nil,
|
||||
predicates.EmptyMetadataProducer,
|
||||
[]priorities.PriorityConfig{},
|
||||
priorities.EmptyMetadataProducer,
|
||||
nodeinfosnapshot.NewEmptySnapshot(),
|
||||
fwk,
|
||||
@@ -1002,9 +998,8 @@ func TestInitPolicyFromFile(t *testing.T) {
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
for i, test := range []struct {
|
||||
policy string
|
||||
expectedPredicates sets.String
|
||||
expectedPrioritizers sets.String
|
||||
policy string
|
||||
expectedPredicates sets.String
|
||||
}{
|
||||
// Test json format policy file
|
||||
{
|
||||
@@ -1024,10 +1019,6 @@ func TestInitPolicyFromFile(t *testing.T) {
|
||||
"PredicateOne",
|
||||
"PredicateTwo",
|
||||
),
|
||||
expectedPrioritizers: sets.NewString(
|
||||
"PriorityOne",
|
||||
"PriorityTwo",
|
||||
),
|
||||
},
|
||||
// Test yaml format policy file
|
||||
{
|
||||
@@ -1046,10 +1037,6 @@ priorities:
|
||||
"PredicateOne",
|
||||
"PredicateTwo",
|
||||
),
|
||||
expectedPrioritizers: sets.NewString(
|
||||
"PriorityOne",
|
||||
"PriorityTwo",
|
||||
),
|
||||
},
|
||||
} {
|
||||
file := fmt.Sprintf("scheduler-policy-config-file-%d", i)
|
||||
@@ -1077,8 +1064,5 @@ priorities:
|
||||
if !schedPredicates.Equal(test.expectedPredicates) {
|
||||
t.Errorf("Expected predicates %v, got %v", test.expectedPredicates, schedPredicates)
|
||||
}
|
||||
if !schedPrioritizers.Equal(test.expectedPrioritizers) {
|
||||
t.Errorf("Expected priority functions %v, got %v", test.expectedPrioritizers, schedPrioritizers)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user