@@ -65,17 +65,17 @@ func init() {
65
65
// Fit is defined based on the absence of port conflicts.
66
66
// This predicate is actually a default predicate, because it is invoked from
67
67
// predicates.GeneralPredicates()
68
- factory .RegisterFitPredicate ("PodFitsHostPorts" , predicates .PodFitsHostPorts )
68
+ factory .RegisterFitPredicate (predicates . PodFitsHostPortsPred , predicates .PodFitsHostPorts )
69
69
// Fit is determined by resource availability.
70
70
// This predicate is actually a default predicate, because it is invoked from
71
71
// predicates.GeneralPredicates()
72
- factory .RegisterFitPredicate ("PodFitsResources" , predicates .PodFitsResources )
72
+ factory .RegisterFitPredicate (predicates . PodFitsResourcesPred , predicates .PodFitsResources )
73
73
// Fit is determined by the presence of the Host parameter and a string match
74
74
// This predicate is actually a default predicate, because it is invoked from
75
75
// predicates.GeneralPredicates()
76
- factory .RegisterFitPredicate ("HostName" , predicates .PodFitsHost )
76
+ factory .RegisterFitPredicate (predicates . HostNamePred , predicates .PodFitsHost )
77
77
// Fit is determined by node selector query.
78
- factory .RegisterFitPredicate ("MatchNodeSelector" , predicates .PodMatchNodeSelector )
78
+ factory .RegisterFitPredicate (predicates . MatchNodeSelectorPred , predicates .PodMatchNodeSelector )
79
79
80
80
// Use equivalence class to speed up heavy predicates phase.
81
81
factory .RegisterGetEquivalencePodFunction (
@@ -117,62 +117,62 @@ func defaultPredicates() sets.String {
117
117
return sets .NewString (
118
118
// Fit is determined by volume zone requirements.
119
119
factory .RegisterFitPredicateFactory (
120
- "NoVolumeZoneConflict" ,
120
+ predicates . NoVolumeZoneConflictPred ,
121
121
func (args factory.PluginFactoryArgs ) algorithm.FitPredicate {
122
122
return predicates .NewVolumeZonePredicate (args .PVInfo , args .PVCInfo , args .StorageClassInfo )
123
123
},
124
124
),
125
125
// Fit is determined by whether or not there would be too many AWS EBS volumes attached to the node
126
126
factory .RegisterFitPredicateFactory (
127
- "MaxEBSVolumeCount" ,
127
+ predicates . MaxEBSVolumeCountPred ,
128
128
func (args factory.PluginFactoryArgs ) algorithm.FitPredicate {
129
129
return predicates .NewMaxPDVolumeCountPredicate (predicates .EBSVolumeFilterType , args .PVInfo , args .PVCInfo )
130
130
},
131
131
),
132
132
// Fit is determined by whether or not there would be too many GCE PD volumes attached to the node
133
133
factory .RegisterFitPredicateFactory (
134
- "MaxGCEPDVolumeCount" ,
134
+ predicates . MaxGCEPDVolumeCountPred ,
135
135
func (args factory.PluginFactoryArgs ) algorithm.FitPredicate {
136
136
return predicates .NewMaxPDVolumeCountPredicate (predicates .GCEPDVolumeFilterType , args .PVInfo , args .PVCInfo )
137
137
},
138
138
),
139
139
// Fit is determined by whether or not there would be too many Azure Disk volumes attached to the node
140
140
factory .RegisterFitPredicateFactory (
141
- "MaxAzureDiskVolumeCount" ,
141
+ predicates . MaxAzureDiskVolumeCountPred ,
142
142
func (args factory.PluginFactoryArgs ) algorithm.FitPredicate {
143
143
return predicates .NewMaxPDVolumeCountPredicate (predicates .AzureDiskVolumeFilterType , args .PVInfo , args .PVCInfo )
144
144
},
145
145
),
146
146
// Fit is determined by inter-pod affinity.
147
147
factory .RegisterFitPredicateFactory (
148
- predicates .MatchInterPodAffinity ,
148
+ predicates .MatchInterPodAffinityPred ,
149
149
func (args factory.PluginFactoryArgs ) algorithm.FitPredicate {
150
150
return predicates .NewPodAffinityPredicate (args .NodeInfo , args .PodLister )
151
151
},
152
152
),
153
153
154
154
// Fit is determined by non-conflicting disk volumes.
155
- factory .RegisterFitPredicate ("NoDiskConflict" , predicates .NoDiskConflict ),
155
+ factory .RegisterFitPredicate (predicates . NoDiskConflictPred , predicates .NoDiskConflict ),
156
156
157
157
// GeneralPredicates are the predicates that are enforced by all Kubernetes components
158
158
// (e.g. kubelet and all schedulers)
159
- factory .RegisterFitPredicate ("GeneralPredicates" , predicates .GeneralPredicates ),
159
+ factory .RegisterFitPredicate (predicates . GeneralPred , predicates .GeneralPredicates ),
160
160
161
161
// Fit is determined by node memory pressure condition.
162
- factory .RegisterFitPredicate ("CheckNodeMemoryPressure" , predicates .CheckNodeMemoryPressurePredicate ),
162
+ factory .RegisterFitPredicate (predicates . CheckNodeMemoryPressurePred , predicates .CheckNodeMemoryPressurePredicate ),
163
163
164
164
// Fit is determined by node disk pressure condition.
165
- factory .RegisterFitPredicate ("CheckNodeDiskPressure" , predicates .CheckNodeDiskPressurePredicate ),
165
+ factory .RegisterFitPredicate (predicates . CheckNodeDiskPressurePred , predicates .CheckNodeDiskPressurePredicate ),
166
166
167
167
// Fit is determined by node conditions: not ready, network unavailable or out of disk.
168
- factory .RegisterMandatoryFitPredicate ("CheckNodeCondition" , predicates .CheckNodeConditionPredicate ),
168
+ factory .RegisterMandatoryFitPredicate (predicates . CheckNodeConditionPred , predicates .CheckNodeConditionPredicate ),
169
169
170
170
// Fit is determined based on whether a pod can tolerate all of the node's taints
171
- factory .RegisterFitPredicate ("PodToleratesNodeTaints" , predicates .PodToleratesNodeTaints ),
171
+ factory .RegisterFitPredicate (predicates . PodToleratesNodeTaintsPred , predicates .PodToleratesNodeTaints ),
172
172
173
173
// Fit is determined by volume topology requirements.
174
174
factory .RegisterFitPredicateFactory (
175
- predicates .CheckVolumeBinding ,
175
+ predicates .CheckVolumeBindingPred ,
176
176
func (args factory.PluginFactoryArgs ) algorithm.FitPredicate {
177
177
return predicates .NewVolumeBindingPredicate (args .VolumeBinder )
178
178
},
@@ -185,18 +185,18 @@ func ApplyFeatureGates() {
185
185
186
186
if utilfeature .DefaultFeatureGate .Enabled (features .TaintNodesByCondition ) {
187
187
// Remove "CheckNodeCondition" predicate
188
- factory .RemoveFitPredicate ("CheckNodeCondition" )
188
+ factory .RemoveFitPredicate (predicates . CheckNodeConditionPred )
189
189
// Remove Key "CheckNodeCondition" From All Algorithm Provider
190
190
// The key will be removed from all providers which in algorithmProviderMap[]
191
191
// if you just want remove specific provider, call func RemovePredicateKeyFromAlgoProvider()
192
- factory .RemovePredicateKeyFromAlgorithmProviderMap ("CheckNodeCondition" )
192
+ factory .RemovePredicateKeyFromAlgorithmProviderMap (predicates . CheckNodeConditionPred )
193
193
194
194
// Fit is determined based on whether a pod can tolerate all of the node's taints
195
- factory .RegisterMandatoryFitPredicate ("PodToleratesNodeTaints" , predicates .PodToleratesNodeTaints )
195
+ factory .RegisterMandatoryFitPredicate (predicates . PodToleratesNodeTaintsPred , predicates .PodToleratesNodeTaints )
196
196
// Insert Key "PodToleratesNodeTaints" To All Algorithm Provider
197
197
// The key will insert to all providers which in algorithmProviderMap[]
198
198
// if you just want insert to specific provider, call func InsertPredicateKeyToAlgoProvider()
199
- factory .InsertPredicateKeyToAlgorithmProviderMap ("PodToleratesNodeTaints" )
199
+ factory .InsertPredicateKeyToAlgorithmProviderMap (predicates . PodToleratesNodeTaintsPred )
200
200
201
201
glog .Warningf ("TaintNodesByCondition is enabled, PodToleratesNodeTaints predicate is mandatory" )
202
202
}
0 commit comments