Skip to content

Commit 7ce873d

Browse files
committed
add catalog-operator control-plane-specific tolerations to unpack jobs
Signed-off-by: grokspawn <[email protected]>
1 parent 3c2163e commit 7ce873d

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

pkg/controller/bundle/bundle_unpacker.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ func (c *ConfigMapUnpacker) job(cmRef *corev1.ObjectReference, bundlePath string
234234
"kubernetes.io/os": "linux",
235235
},
236236
Tolerations: []corev1.Toleration{
237+
// arch-specific tolerations
237238
{
238239
Key: "kubernetes.io/arch",
239240
Value: "amd64",
@@ -254,6 +255,24 @@ func (c *ConfigMapUnpacker) job(cmRef *corev1.ObjectReference, bundlePath string
254255
Value: "s390x",
255256
Operator: "Equal",
256257
},
258+
// control-plane-specific tolerations
259+
{
260+
Key: "node-role.kubernetes.io/master",
261+
Operator: "Exists",
262+
Effect: "NoSchedule",
263+
},
264+
{
265+
Key: "node.kubernetes.io/unreachable",
266+
Operator: "Exists",
267+
Effect: "NoExecute",
268+
TolerationSeconds: ptr.To[int64](120),
269+
},
270+
{
271+
Key: "node.kubernetes.io/not-ready",
272+
Operator: "Exists",
273+
Effect: "NoExecute",
274+
TolerationSeconds: ptr.To[int64](120),
275+
},
257276
},
258277
},
259278
},

pkg/controller/bundle/bundle_unpacker_test.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ func TestConfigMapUnpacker(t *testing.T) {
346346
"kubernetes.io/os": "linux",
347347
},
348348
Tolerations: []corev1.Toleration{
349+
// arch-specific tolerations
349350
{
350351
Key: "kubernetes.io/arch",
351352
Value: "amd64",
@@ -366,6 +367,24 @@ func TestConfigMapUnpacker(t *testing.T) {
366367
Value: "s390x",
367368
Operator: "Equal",
368369
},
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+
},
369388
},
370389
},
371390
},
@@ -1132,6 +1151,7 @@ func TestConfigMapUnpacker(t *testing.T) {
11321151
"kubernetes.io/os": "linux",
11331152
},
11341153
Tolerations: []corev1.Toleration{
1154+
// arch-specific tolerations
11351155
{
11361156
Key: "kubernetes.io/arch",
11371157
Value: "amd64",
@@ -1152,6 +1172,24 @@ func TestConfigMapUnpacker(t *testing.T) {
11521172
Value: "s390x",
11531173
Operator: "Equal",
11541174
},
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+
},
11551193
},
11561194
},
11571195
},

0 commit comments

Comments
 (0)