@@ -59,6 +59,48 @@ func TestConfigMapUnpacker(t *testing.T) {
59
59
customAnnotationDuration := 2 * time .Minute
60
60
customAnnotationTimeoutSeconds := int64 (customAnnotationDuration .Seconds ())
61
61
62
+ podTolerations := []corev1.Toleration {
63
+ // arch-specific tolerations
64
+ {
65
+ Key : "kubernetes.io/arch" ,
66
+ Value : "amd64" ,
67
+ Operator : "Equal" ,
68
+ },
69
+ {
70
+ Key : "kubernetes.io/arch" ,
71
+ Value : "arm64" ,
72
+ Operator : "Equal" ,
73
+ },
74
+ {
75
+ Key : "kubernetes.io/arch" ,
76
+ Value : "ppc64le" ,
77
+ Operator : "Equal" ,
78
+ },
79
+ {
80
+ Key : "kubernetes.io/arch" ,
81
+ Value : "s390x" ,
82
+ Operator : "Equal" ,
83
+ },
84
+ // control-plane-specific tolerations
85
+ {
86
+ Key : "node-role.kubernetes.io/master" ,
87
+ Operator : "Exists" ,
88
+ Effect : "NoSchedule" ,
89
+ },
90
+ {
91
+ Key : "node.kubernetes.io/unreachable" ,
92
+ Operator : "Exists" ,
93
+ Effect : "NoExecute" ,
94
+ TolerationSeconds : ptr.To [int64 ](120 ),
95
+ },
96
+ {
97
+ Key : "node.kubernetes.io/not-ready" ,
98
+ Operator : "Exists" ,
99
+ Effect : "NoExecute" ,
100
+ TolerationSeconds : ptr.To [int64 ](120 ),
101
+ },
102
+ }
103
+
62
104
type fields struct {
63
105
objs []runtime.Object
64
106
crs []runtime.Object
@@ -345,47 +387,7 @@ func TestConfigMapUnpacker(t *testing.T) {
345
387
NodeSelector : map [string ]string {
346
388
"kubernetes.io/os" : "linux" ,
347
389
},
348
- Tolerations : []corev1.Toleration {
349
- // arch-specific tolerations
350
- {
351
- Key : "kubernetes.io/arch" ,
352
- Value : "amd64" ,
353
- Operator : "Equal" ,
354
- },
355
- {
356
- Key : "kubernetes.io/arch" ,
357
- Value : "arm64" ,
358
- Operator : "Equal" ,
359
- },
360
- {
361
- Key : "kubernetes.io/arch" ,
362
- Value : "ppc64le" ,
363
- Operator : "Equal" ,
364
- },
365
- {
366
- Key : "kubernetes.io/arch" ,
367
- Value : "s390x" ,
368
- Operator : "Equal" ,
369
- },
370
- // control-plane-specific tolerations
371
- {
372
- Key : "node-role.kubernetes.io/master" ,
373
- Operator : "Exists" ,
374
- Effect : "NoSchedule" ,
375
- },
376
- {
377
- Key : "node.kubernetes.io/unreachable" ,
378
- Operator : "Exists" ,
379
- Effect : "NoExecute" ,
380
- TolerationSeconds : ptr.To [int64 ](120 ),
381
- },
382
- {
383
- Key : "node.kubernetes.io/not-ready" ,
384
- Operator : "Exists" ,
385
- Effect : "NoExecute" ,
386
- TolerationSeconds : ptr.To [int64 ](120 ),
387
- },
388
- },
390
+ Tolerations : podTolerations ,
389
391
},
390
392
},
391
393
},
@@ -601,28 +603,7 @@ func TestConfigMapUnpacker(t *testing.T) {
601
603
NodeSelector : map [string ]string {
602
604
"kubernetes.io/os" : "linux" ,
603
605
},
604
- Tolerations : []corev1.Toleration {
605
- {
606
- Key : "kubernetes.io/arch" ,
607
- Value : "amd64" ,
608
- Operator : "Equal" ,
609
- },
610
- {
611
- Key : "kubernetes.io/arch" ,
612
- Value : "arm64" ,
613
- Operator : "Equal" ,
614
- },
615
- {
616
- Key : "kubernetes.io/arch" ,
617
- Value : "ppc64le" ,
618
- Operator : "Equal" ,
619
- },
620
- {
621
- Key : "kubernetes.io/arch" ,
622
- Value : "s390x" ,
623
- Operator : "Equal" ,
624
- },
625
- },
606
+ Tolerations : podTolerations ,
626
607
},
627
608
},
628
609
},
@@ -878,28 +859,7 @@ func TestConfigMapUnpacker(t *testing.T) {
878
859
NodeSelector : map [string ]string {
879
860
"kubernetes.io/os" : "linux" ,
880
861
},
881
- Tolerations : []corev1.Toleration {
882
- {
883
- Key : "kubernetes.io/arch" ,
884
- Value : "amd64" ,
885
- Operator : "Equal" ,
886
- },
887
- {
888
- Key : "kubernetes.io/arch" ,
889
- Value : "arm64" ,
890
- Operator : "Equal" ,
891
- },
892
- {
893
- Key : "kubernetes.io/arch" ,
894
- Value : "ppc64le" ,
895
- Operator : "Equal" ,
896
- },
897
- {
898
- Key : "kubernetes.io/arch" ,
899
- Value : "s390x" ,
900
- Operator : "Equal" ,
901
- },
902
- },
862
+ Tolerations : podTolerations ,
903
863
},
904
864
},
905
865
},
@@ -1150,47 +1110,7 @@ func TestConfigMapUnpacker(t *testing.T) {
1150
1110
NodeSelector : map [string ]string {
1151
1111
"kubernetes.io/os" : "linux" ,
1152
1112
},
1153
- Tolerations : []corev1.Toleration {
1154
- // arch-specific tolerations
1155
- {
1156
- Key : "kubernetes.io/arch" ,
1157
- Value : "amd64" ,
1158
- Operator : "Equal" ,
1159
- },
1160
- {
1161
- Key : "kubernetes.io/arch" ,
1162
- Value : "arm64" ,
1163
- Operator : "Equal" ,
1164
- },
1165
- {
1166
- Key : "kubernetes.io/arch" ,
1167
- Value : "ppc64le" ,
1168
- Operator : "Equal" ,
1169
- },
1170
- {
1171
- Key : "kubernetes.io/arch" ,
1172
- Value : "s390x" ,
1173
- Operator : "Equal" ,
1174
- },
1175
- // control-plane-specific tolerations
1176
- {
1177
- Key : "node-role.kubernetes.io/master" ,
1178
- Operator : "Exists" ,
1179
- Effect : "NoSchedule" ,
1180
- },
1181
- {
1182
- Key : "node.kubernetes.io/unreachable" ,
1183
- Operator : "Exists" ,
1184
- Effect : "NoExecute" ,
1185
- TolerationSeconds : ptr.To [int64 ](120 ),
1186
- },
1187
- {
1188
- Key : "node.kubernetes.io/not-ready" ,
1189
- Operator : "Exists" ,
1190
- Effect : "NoExecute" ,
1191
- TolerationSeconds : ptr.To [int64 ](120 ),
1192
- },
1193
- },
1113
+ Tolerations : podTolerations ,
1194
1114
},
1195
1115
},
1196
1116
},
@@ -1411,28 +1331,7 @@ func TestConfigMapUnpacker(t *testing.T) {
1411
1331
NodeSelector : map [string ]string {
1412
1332
"kubernetes.io/os" : "linux" ,
1413
1333
},
1414
- Tolerations : []corev1.Toleration {
1415
- {
1416
- Key : "kubernetes.io/arch" ,
1417
- Value : "amd64" ,
1418
- Operator : "Equal" ,
1419
- },
1420
- {
1421
- Key : "kubernetes.io/arch" ,
1422
- Value : "arm64" ,
1423
- Operator : "Equal" ,
1424
- },
1425
- {
1426
- Key : "kubernetes.io/arch" ,
1427
- Value : "ppc64le" ,
1428
- Operator : "Equal" ,
1429
- },
1430
- {
1431
- Key : "kubernetes.io/arch" ,
1432
- Value : "s390x" ,
1433
- Operator : "Equal" ,
1434
- },
1435
- },
1334
+ Tolerations : podTolerations ,
1436
1335
},
1437
1336
},
1438
1337
},
@@ -1666,28 +1565,7 @@ func TestConfigMapUnpacker(t *testing.T) {
1666
1565
NodeSelector : map [string ]string {
1667
1566
"kubernetes.io/os" : "linux" ,
1668
1567
},
1669
- Tolerations : []corev1.Toleration {
1670
- {
1671
- Key : "kubernetes.io/arch" ,
1672
- Value : "amd64" ,
1673
- Operator : "Equal" ,
1674
- },
1675
- {
1676
- Key : "kubernetes.io/arch" ,
1677
- Value : "arm64" ,
1678
- Operator : "Equal" ,
1679
- },
1680
- {
1681
- Key : "kubernetes.io/arch" ,
1682
- Value : "ppc64le" ,
1683
- Operator : "Equal" ,
1684
- },
1685
- {
1686
- Key : "kubernetes.io/arch" ,
1687
- Value : "s390x" ,
1688
- Operator : "Equal" ,
1689
- },
1690
- },
1568
+ Tolerations : podTolerations ,
1691
1569
},
1692
1570
},
1693
1571
},
0 commit comments