@@ -124,7 +124,17 @@ func TestTopologyCachePluginWithoutUpdates(t *testing.T) {
124
124
},
125
125
},
126
126
nodeResourceTopologies : []* topologyv1alpha2.NodeResourceTopology {
127
- MakeNRT ().Name ("fake-node-cache-1" ).Policy (topologyv1alpha2 .SingleNUMANodeContainerLevel ).
127
+ MakeNRT ().Name ("fake-node-cache-1" ).
128
+ Attributes (topologyv1alpha2.AttributeList {
129
+ {
130
+ Name : noderesourcetopology .AttributePolicy ,
131
+ Value : "single-numa-node" ,
132
+ },
133
+ {
134
+ Name : noderesourcetopology .AttributeScope ,
135
+ Value : "container" ,
136
+ },
137
+ }).
128
138
Zone (
129
139
topologyv1alpha2.ResourceInfoList {
130
140
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "30" ),
@@ -135,7 +145,17 @@ func TestTopologyCachePluginWithoutUpdates(t *testing.T) {
135
145
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "30" ),
136
146
noderesourcetopology .MakeTopologyResInfo (memory , "64Gi" , "62Gi" ),
137
147
}).Obj (),
138
- MakeNRT ().Name ("fake-node-cache-2" ).Policy (topologyv1alpha2 .SingleNUMANodeContainerLevel ).
148
+ MakeNRT ().Name ("fake-node-cache-2" ).
149
+ Attributes (topologyv1alpha2.AttributeList {
150
+ {
151
+ Name : noderesourcetopology .AttributePolicy ,
152
+ Value : "single-numa-node" ,
153
+ },
154
+ {
155
+ Name : noderesourcetopology .AttributeScope ,
156
+ Value : "container" ,
157
+ },
158
+ }).
139
159
Zone (
140
160
topologyv1alpha2.ResourceInfoList {
141
161
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "10" ),
@@ -193,7 +213,17 @@ func TestTopologyCachePluginWithoutUpdates(t *testing.T) {
193
213
},
194
214
},
195
215
nodeResourceTopologies : []* topologyv1alpha2.NodeResourceTopology {
196
- MakeNRT ().Name ("fake-node-cache-1" ).Policy (topologyv1alpha2 .SingleNUMANodeContainerLevel ).
216
+ MakeNRT ().Name ("fake-node-cache-1" ).
217
+ Attributes (topologyv1alpha2.AttributeList {
218
+ {
219
+ Name : noderesourcetopology .AttributePolicy ,
220
+ Value : "single-numa-node" ,
221
+ },
222
+ {
223
+ Name : noderesourcetopology .AttributeScope ,
224
+ Value : "container" ,
225
+ },
226
+ }).
197
227
Zone (
198
228
topologyv1alpha2.ResourceInfoList {
199
229
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "30" ),
@@ -204,7 +234,17 @@ func TestTopologyCachePluginWithoutUpdates(t *testing.T) {
204
234
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "30" ),
205
235
noderesourcetopology .MakeTopologyResInfo (memory , "64Gi" , "62Gi" ),
206
236
}).Obj (),
207
- MakeNRT ().Name ("fake-node-cache-2" ).Policy (topologyv1alpha2 .SingleNUMANodeContainerLevel ).
237
+ MakeNRT ().Name ("fake-node-cache-2" ).
238
+ Attributes (topologyv1alpha2.AttributeList {
239
+ {
240
+ Name : noderesourcetopology .AttributePolicy ,
241
+ Value : "single-numa-node" ,
242
+ },
243
+ {
244
+ Name : noderesourcetopology .AttributeScope ,
245
+ Value : "container" ,
246
+ },
247
+ }).
208
248
Zone (
209
249
topologyv1alpha2.ResourceInfoList {
210
250
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "10" ),
@@ -244,7 +284,17 @@ func TestTopologyCachePluginWithoutUpdates(t *testing.T) {
244
284
},
245
285
},
246
286
nodeResourceTopologies : []* topologyv1alpha2.NodeResourceTopology {
247
- MakeNRT ().Name ("fake-node-cache-1" ).Policy (topologyv1alpha2 .SingleNUMANodeContainerLevel ).
287
+ MakeNRT ().Name ("fake-node-cache-1" ).
288
+ Attributes (topologyv1alpha2.AttributeList {
289
+ {
290
+ Name : noderesourcetopology .AttributePolicy ,
291
+ Value : "single-numa-node" ,
292
+ },
293
+ {
294
+ Name : noderesourcetopology .AttributeScope ,
295
+ Value : "container" ,
296
+ },
297
+ }).
248
298
Zone (
249
299
topologyv1alpha2.ResourceInfoList {
250
300
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "30" ),
@@ -255,7 +305,17 @@ func TestTopologyCachePluginWithoutUpdates(t *testing.T) {
255
305
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "30" ),
256
306
noderesourcetopology .MakeTopologyResInfo (memory , "64Gi" , "62Gi" ),
257
307
}).Obj (),
258
- MakeNRT ().Name ("fake-node-cache-2" ).Policy (topologyv1alpha2 .SingleNUMANodeContainerLevel ).
308
+ MakeNRT ().Name ("fake-node-cache-2" ).
309
+ Attributes (topologyv1alpha2.AttributeList {
310
+ {
311
+ Name : noderesourcetopology .AttributePolicy ,
312
+ Value : "single-numa-node" ,
313
+ },
314
+ {
315
+ Name : noderesourcetopology .AttributeScope ,
316
+ Value : "container" ,
317
+ },
318
+ }).
259
319
Zone (
260
320
topologyv1alpha2.ResourceInfoList {
261
321
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "10" ),
@@ -293,7 +353,17 @@ func TestTopologyCachePluginWithoutUpdates(t *testing.T) {
293
353
},
294
354
},
295
355
nodeResourceTopologies : []* topologyv1alpha2.NodeResourceTopology {
296
- MakeNRT ().Name ("fake-node-cache-1" ).Policy (topologyv1alpha2 .SingleNUMANodeContainerLevel ).
356
+ MakeNRT ().Name ("fake-node-cache-1" ).
357
+ Attributes (topologyv1alpha2.AttributeList {
358
+ {
359
+ Name : noderesourcetopology .AttributePolicy ,
360
+ Value : "single-numa-node" ,
361
+ },
362
+ {
363
+ Name : noderesourcetopology .AttributeScope ,
364
+ Value : "container" ,
365
+ },
366
+ }).
297
367
Zone (
298
368
topologyv1alpha2.ResourceInfoList {
299
369
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "30" ),
@@ -304,7 +374,17 @@ func TestTopologyCachePluginWithoutUpdates(t *testing.T) {
304
374
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "30" ),
305
375
noderesourcetopology .MakeTopologyResInfo (memory , "64Gi" , "62Gi" ),
306
376
}).Obj (),
307
- MakeNRT ().Name ("fake-node-cache-2" ).Policy (topologyv1alpha2 .SingleNUMANodeContainerLevel ).
377
+ MakeNRT ().Name ("fake-node-cache-2" ).
378
+ Attributes (topologyv1alpha2.AttributeList {
379
+ {
380
+ Name : noderesourcetopology .AttributePolicy ,
381
+ Value : "single-numa-node" ,
382
+ },
383
+ {
384
+ Name : noderesourcetopology .AttributeScope ,
385
+ Value : "container" ,
386
+ },
387
+ }).
308
388
Zone (
309
389
topologyv1alpha2.ResourceInfoList {
310
390
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "10" ),
@@ -347,7 +427,17 @@ func TestTopologyCachePluginWithoutUpdates(t *testing.T) {
347
427
},
348
428
},
349
429
nodeResourceTopologies : []* topologyv1alpha2.NodeResourceTopology {
350
- MakeNRT ().Name ("fake-node-cache-1" ).Policy (topologyv1alpha2 .SingleNUMANodeContainerLevel ).
430
+ MakeNRT ().Name ("fake-node-cache-1" ).
431
+ Attributes (topologyv1alpha2.AttributeList {
432
+ {
433
+ Name : noderesourcetopology .AttributePolicy ,
434
+ Value : "single-numa-node" ,
435
+ },
436
+ {
437
+ Name : noderesourcetopology .AttributeScope ,
438
+ Value : "container" ,
439
+ },
440
+ }).
351
441
Zone (
352
442
topologyv1alpha2.ResourceInfoList {
353
443
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "30" ),
@@ -358,7 +448,17 @@ func TestTopologyCachePluginWithoutUpdates(t *testing.T) {
358
448
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "30" ),
359
449
noderesourcetopology .MakeTopologyResInfo (memory , "64Gi" , "62Gi" ),
360
450
}).Obj (),
361
- MakeNRT ().Name ("fake-node-cache-2" ).Policy (topologyv1alpha2 .SingleNUMANodeContainerLevel ).
451
+ MakeNRT ().Name ("fake-node-cache-2" ).
452
+ Attributes (topologyv1alpha2.AttributeList {
453
+ {
454
+ Name : noderesourcetopology .AttributePolicy ,
455
+ Value : "single-numa-node" ,
456
+ },
457
+ {
458
+ Name : noderesourcetopology .AttributeScope ,
459
+ Value : "container" ,
460
+ },
461
+ }).
362
462
Zone (
363
463
topologyv1alpha2.ResourceInfoList {
364
464
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "10" ),
@@ -651,16 +751,24 @@ func TestTopologyCachePluginWithUpdates(t *testing.T) {
651
751
652
752
pfpSign := mkPFP ("fake-node-cache-1" , tt .podDescs [0 ].pod )
653
753
updatedNRTs := []* topologyv1alpha2.NodeResourceTopology {
654
- MakeNRT ().Name ("fake-node-cache-1" ).Policy (topologyv1alpha2 .SingleNUMANodeContainerLevel ).
655
- Annotations (map [string ]string {
656
- podfingerprint .Annotation : pfpSign ,
657
- }).
754
+ MakeNRT ().Name ("fake-node-cache-1" ).
658
755
Attributes (topologyv1alpha2.AttributeList {
756
+ {
757
+ Name : noderesourcetopology .AttributePolicy ,
758
+ Value : "single-numa-node" ,
759
+ },
760
+ {
761
+ Name : noderesourcetopology .AttributeScope ,
762
+ Value : "container" ,
763
+ },
659
764
{
660
765
Name : podfingerprint .Attribute ,
661
766
Value : pfpSign ,
662
767
},
663
768
}).
769
+ Annotations (map [string ]string {
770
+ podfingerprint .Annotation : pfpSign ,
771
+ }).
664
772
Zone (
665
773
topologyv1alpha2.ResourceInfoList {
666
774
noderesourcetopology .MakeTopologyResInfo (cpu , "32" , "6" ),
@@ -689,10 +797,16 @@ func TestTopologyCachePluginWithUpdates(t *testing.T) {
689
797
time .Sleep (time .Duration (5 * matchArgs .CacheResyncPeriodSeconds ) * time .Second )
690
798
691
799
updatedNRTs = []* topologyv1alpha2.NodeResourceTopology {
692
- MakeNRT ().Name ("fake-node-cache-1" ).Policy (topologyv1alpha2 .SingleNUMANodeContainerLevel ).
693
- Annotations (map [string ]string {
694
- podfingerprint .Annotation : mkPFP ("fake-node-cache-1" , tt .podDescs [0 ].pod ),
695
- "foo" : "bar" , // we need _ANY_ change to the object to trigger the update
800
+ MakeNRT ().Name ("fake-node-cache-1" ).
801
+ Attributes (topologyv1alpha2.AttributeList {
802
+ {
803
+ Name : noderesourcetopology .AttributePolicy ,
804
+ Value : "single-numa-node" ,
805
+ },
806
+ {
807
+ Name : noderesourcetopology .AttributeScope ,
808
+ Value : "container" ,
809
+ },
696
810
}).
697
811
Zone (
698
812
topologyv1alpha2.ResourceInfoList {
0 commit comments