mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
refactor(scheduler): Move priority types to priorities package
This moves the priority types from the algorithm package to priorities package. Idea is to move the type to the packages where it is implemented. This will ease the future refactor process.
This commit is contained in:
@@ -26,7 +26,7 @@ import (
|
||||
func init() {
|
||||
// Register functions that extract metadata used by priorities computations.
|
||||
factory.RegisterPriorityMetadataProducerFactory(
|
||||
func(args factory.PluginFactoryArgs) algorithm.PriorityMetadataProducer {
|
||||
func(args factory.PluginFactoryArgs) priorities.PriorityMetadataProducer {
|
||||
return priorities.NewPriorityMetadataFactory(args.ServiceLister, args.ControllerLister, args.ReplicaSetLister, args.StatefulSetLister)
|
||||
})
|
||||
|
||||
@@ -37,7 +37,7 @@ func init() {
|
||||
factory.RegisterPriorityConfigFactory(
|
||||
priorities.ServiceSpreadingPriority,
|
||||
factory.PriorityConfigFactory{
|
||||
MapReduceFunction: func(args factory.PluginFactoryArgs) (algorithm.PriorityMapFunction, algorithm.PriorityReduceFunction) {
|
||||
MapReduceFunction: func(args factory.PluginFactoryArgs) (priorities.PriorityMapFunction, priorities.PriorityReduceFunction) {
|
||||
return priorities.NewSelectorSpreadPriority(args.ServiceLister, algorithm.EmptyControllerLister{}, algorithm.EmptyReplicaSetLister{}, algorithm.EmptyStatefulSetLister{})
|
||||
},
|
||||
Weight: 1,
|
||||
@@ -58,7 +58,7 @@ func init() {
|
||||
factory.RegisterPriorityConfigFactory(
|
||||
priorities.SelectorSpreadPriority,
|
||||
factory.PriorityConfigFactory{
|
||||
MapReduceFunction: func(args factory.PluginFactoryArgs) (algorithm.PriorityMapFunction, algorithm.PriorityReduceFunction) {
|
||||
MapReduceFunction: func(args factory.PluginFactoryArgs) (priorities.PriorityMapFunction, priorities.PriorityReduceFunction) {
|
||||
return priorities.NewSelectorSpreadPriority(args.ServiceLister, args.ControllerLister, args.ReplicaSetLister, args.StatefulSetLister)
|
||||
},
|
||||
Weight: 1,
|
||||
@@ -69,7 +69,7 @@ func init() {
|
||||
factory.RegisterPriorityConfigFactory(
|
||||
priorities.InterPodAffinityPriority,
|
||||
factory.PriorityConfigFactory{
|
||||
Function: func(args factory.PluginFactoryArgs) algorithm.PriorityFunction {
|
||||
Function: func(args factory.PluginFactoryArgs) priorities.PriorityFunction {
|
||||
return priorities.NewInterPodAffinityPriority(args.NodeInfo, args.NodeLister, args.PodLister, args.HardPodAffinitySymmetricWeight)
|
||||
},
|
||||
Weight: 1,
|
||||
|
||||
Reference in New Issue
Block a user