@@ -162,6 +162,70 @@ func TestSchedulerCreationFromConfigMap(t *testing.T) {
162
162
),
163
163
expectedPrioritizers : sets .NewString (),
164
164
},
165
+ {
166
+ policy : `apiVersion: v1
167
+ kind: Policy
168
+ predicates:
169
+ - name: PredicateOne
170
+ - name: PredicateTwo
171
+ priorities:
172
+ - name: PriorityOne
173
+ weight: 1
174
+ - name: PriorityTwo
175
+ weight: 5
176
+ ` ,
177
+ expectedPredicates : sets .NewString (
178
+ "CheckNodeCondition" , // mandatory predicate
179
+ "PredicateOne" ,
180
+ "PredicateTwo" ,
181
+ ),
182
+ expectedPrioritizers : sets .NewString (
183
+ "PriorityOne" ,
184
+ "PriorityTwo" ,
185
+ ),
186
+ },
187
+ {
188
+ policy : `apiVersion: v1
189
+ kind: Policy
190
+ ` ,
191
+ expectedPredicates : sets .NewString (
192
+ "CheckNodeCondition" , // mandatory predicate
193
+ "CheckNodeDiskPressure" ,
194
+ "CheckNodeMemoryPressure" ,
195
+ "CheckNodePIDPressure" ,
196
+ "CheckVolumeBinding" ,
197
+ "GeneralPredicates" ,
198
+ "MatchInterPodAffinity" ,
199
+ "MaxAzureDiskVolumeCount" ,
200
+ "MaxCSIVolumeCountPred" ,
201
+ "MaxEBSVolumeCount" ,
202
+ "MaxGCEPDVolumeCount" ,
203
+ "NoDiskConflict" ,
204
+ "NoVolumeZoneConflict" ,
205
+ "PodToleratesNodeTaints" ,
206
+ ),
207
+ expectedPrioritizers : sets .NewString (
208
+ "BalancedResourceAllocation" ,
209
+ "InterPodAffinityPriority" ,
210
+ "LeastRequestedPriority" ,
211
+ "NodeAffinityPriority" ,
212
+ "NodePreferAvoidPodsPriority" ,
213
+ "SelectorSpreadPriority" ,
214
+ "TaintTolerationPriority" ,
215
+ "ImageLocalityPriority" ,
216
+ ),
217
+ },
218
+ {
219
+ policy : `apiVersion: v1
220
+ kind: Policy
221
+ predicates: []
222
+ priorities: []
223
+ ` ,
224
+ expectedPredicates : sets .NewString (
225
+ "CheckNodeCondition" , // mandatory predicate
226
+ ),
227
+ expectedPrioritizers : sets .NewString (),
228
+ },
165
229
} {
166
230
// Add a ConfigMap object.
167
231
configPolicyName := fmt .Sprintf ("scheduler-custom-policy-config-%d" , i )
0 commit comments