rename PluginConfigArgs to AlgorithmConfigArgs

This commit is contained in:
Abdullah Gharaibeh
2019-11-14 11:24:54 -05:00
parent 3b440dfd55
commit 05606bb6e4
6 changed files with 45 additions and 46 deletions

View File

@@ -24,7 +24,7 @@ import (
func init() {
// Register functions that extract metadata used by predicates computations.
scheduler.RegisterPredicateMetadataProducerFactory(
func(args scheduler.PluginFactoryArgs) predicates.MetadataProducer {
func(args scheduler.AlgorithmFactoryArgs) predicates.MetadataProducer {
f := &predicates.MetadataProducerFactory{}
return f.GetPredicateMetadata
})
@@ -54,7 +54,7 @@ func init() {
// Fit is determined by volume zone requirements.
scheduler.RegisterFitPredicateFactory(
predicates.NoVolumeZoneConflictPred,
func(args scheduler.PluginFactoryArgs) predicates.FitPredicate {
func(args scheduler.AlgorithmFactoryArgs) predicates.FitPredicate {
pvLister := args.InformerFactory.Core().V1().PersistentVolumes().Lister()
pvcLister := args.InformerFactory.Core().V1().PersistentVolumeClaims().Lister()
storageClassLister := args.InformerFactory.Storage().V1().StorageClasses().Lister()
@@ -64,7 +64,7 @@ func init() {
// Fit is determined by whether or not there would be too many AWS EBS volumes attached to the node
scheduler.RegisterFitPredicateFactory(
predicates.MaxEBSVolumeCountPred,
func(args scheduler.PluginFactoryArgs) predicates.FitPredicate {
func(args scheduler.AlgorithmFactoryArgs) predicates.FitPredicate {
csiNodeLister := scheduler.GetCSINodeLister(args.InformerFactory)
pvLister := args.InformerFactory.Core().V1().PersistentVolumes().Lister()
pvcLister := args.InformerFactory.Core().V1().PersistentVolumeClaims().Lister()
@@ -75,7 +75,7 @@ func init() {
// Fit is determined by whether or not there would be too many GCE PD volumes attached to the node
scheduler.RegisterFitPredicateFactory(
predicates.MaxGCEPDVolumeCountPred,
func(args scheduler.PluginFactoryArgs) predicates.FitPredicate {
func(args scheduler.AlgorithmFactoryArgs) predicates.FitPredicate {
csiNodeLister := scheduler.GetCSINodeLister(args.InformerFactory)
pvLister := args.InformerFactory.Core().V1().PersistentVolumes().Lister()
pvcLister := args.InformerFactory.Core().V1().PersistentVolumeClaims().Lister()
@@ -86,7 +86,7 @@ func init() {
// Fit is determined by whether or not there would be too many Azure Disk volumes attached to the node
scheduler.RegisterFitPredicateFactory(
predicates.MaxAzureDiskVolumeCountPred,
func(args scheduler.PluginFactoryArgs) predicates.FitPredicate {
func(args scheduler.AlgorithmFactoryArgs) predicates.FitPredicate {
csiNodeLister := scheduler.GetCSINodeLister(args.InformerFactory)
pvLister := args.InformerFactory.Core().V1().PersistentVolumes().Lister()
pvcLister := args.InformerFactory.Core().V1().PersistentVolumeClaims().Lister()
@@ -96,7 +96,7 @@ func init() {
)
scheduler.RegisterFitPredicateFactory(
predicates.MaxCSIVolumeCountPred,
func(args scheduler.PluginFactoryArgs) predicates.FitPredicate {
func(args scheduler.AlgorithmFactoryArgs) predicates.FitPredicate {
csiNodeLister := scheduler.GetCSINodeLister(args.InformerFactory)
pvLister := args.InformerFactory.Core().V1().PersistentVolumes().Lister()
pvcLister := args.InformerFactory.Core().V1().PersistentVolumeClaims().Lister()
@@ -106,7 +106,7 @@ func init() {
)
scheduler.RegisterFitPredicateFactory(
predicates.MaxCinderVolumeCountPred,
func(args scheduler.PluginFactoryArgs) predicates.FitPredicate {
func(args scheduler.AlgorithmFactoryArgs) predicates.FitPredicate {
csiNodeLister := scheduler.GetCSINodeLister(args.InformerFactory)
pvLister := args.InformerFactory.Core().V1().PersistentVolumes().Lister()
pvcLister := args.InformerFactory.Core().V1().PersistentVolumeClaims().Lister()
@@ -118,7 +118,7 @@ func init() {
// Fit is determined by inter-pod affinity.
scheduler.RegisterFitPredicateFactory(
predicates.MatchInterPodAffinityPred,
func(args scheduler.PluginFactoryArgs) predicates.FitPredicate {
func(args scheduler.AlgorithmFactoryArgs) predicates.FitPredicate {
return predicates.NewPodAffinityPredicate(args.SharedLister.NodeInfos(), args.SharedLister.Pods())
},
)
@@ -139,7 +139,7 @@ func init() {
// Fit is determined by volume topology requirements.
scheduler.RegisterFitPredicateFactory(
predicates.CheckVolumeBindingPred,
func(args scheduler.PluginFactoryArgs) predicates.FitPredicate {
func(args scheduler.AlgorithmFactoryArgs) predicates.FitPredicate {
return predicates.NewVolumeBindingPredicate(args.VolumeBinder)
},
)

View File

@@ -25,7 +25,7 @@ import (
func init() {
// Register functions that extract metadata used by priorities computations.
scheduler.RegisterPriorityMetadataProducerFactory(
func(args scheduler.PluginFactoryArgs) priorities.MetadataProducer {
func(args scheduler.AlgorithmFactoryArgs) priorities.MetadataProducer {
serviceLister := args.InformerFactory.Core().V1().Services().Lister()
controllerLister := args.InformerFactory.Core().V1().ReplicationControllers().Lister()
replicaSetLister := args.InformerFactory.Apps().V1().ReplicaSets().Lister()
@@ -40,7 +40,7 @@ func init() {
scheduler.RegisterPriorityConfigFactory(
priorities.ServiceSpreadingPriority,
scheduler.PriorityConfigFactory{
MapReduceFunction: func(args scheduler.PluginFactoryArgs) (priorities.PriorityMapFunction, priorities.PriorityReduceFunction) {
MapReduceFunction: func(args scheduler.AlgorithmFactoryArgs) (priorities.PriorityMapFunction, priorities.PriorityReduceFunction) {
serviceLister := args.InformerFactory.Core().V1().Services().Lister()
return priorities.NewSelectorSpreadPriority(serviceLister, algorithm.EmptyControllerLister{}, algorithm.EmptyReplicaSetLister{}, algorithm.EmptyStatefulSetLister{})
},
@@ -58,7 +58,7 @@ func init() {
scheduler.RegisterPriorityConfigFactory(
priorities.SelectorSpreadPriority,
scheduler.PriorityConfigFactory{
MapReduceFunction: func(args scheduler.PluginFactoryArgs) (priorities.PriorityMapFunction, priorities.PriorityReduceFunction) {
MapReduceFunction: func(args scheduler.AlgorithmFactoryArgs) (priorities.PriorityMapFunction, priorities.PriorityReduceFunction) {
serviceLister := args.InformerFactory.Core().V1().Services().Lister()
controllerLister := args.InformerFactory.Core().V1().ReplicationControllers().Lister()
replicaSetLister := args.InformerFactory.Apps().V1().ReplicaSets().Lister()