Skip to content

Commit d79cae1

Browse files
Merge pull request #1143 from deads2k/toleration
OCPBUGS-41527: Add tolerations to survive scheduler taint manager e2e tests on workers
2 parents db0e811 + 8acd88e commit d79cae1

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

pkg/manifests/assets/router/deployment.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ spec:
6969
- mountPath: /var/run/configmaps/service-ca
7070
name: service-ca-bundle
7171
readOnly: true
72+
tolerations:
73+
# Ensure the pod isn't deleted during serial NoExecuteTaintManager tests.
74+
# Remember that NoExecute uses Delete, not Evict, because removing the pod
75+
# is non-optional. This means that PDBs are not honored.
76+
- key: "kubernetes.io/e2e-evict-taint-key"
77+
operator: "Equal"
78+
value: "evictTaintVal"
79+
effect: "NoExecute"
7280
volumes:
7381
- name: default-certificate
7482
secret:

pkg/operator/controller/ingress/deployment_test.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,15 @@ func Test_desiredRouterDeployment(t *testing.T) {
410410
if len(deployment.Spec.Template.Spec.NodeSelector) == 0 {
411411
t.Error("router Deployment has no default node selector")
412412
}
413-
if len(deployment.Spec.Template.Spec.Tolerations) != 0 {
414-
t.Errorf("router Deployment has unexpected toleration: %#v",
415-
deployment.Spec.Template.Spec.Tolerations)
413+
e2eToleration := corev1.Toleration{
414+
Key: "kubernetes.io/e2e-evict-taint-key",
415+
Value: "evictTaintVal",
416+
Operator: corev1.TolerationOpEqual,
417+
Effect: corev1.TaintEffectNoExecute,
418+
}
419+
expectedTolerations := []corev1.Toleration{e2eToleration}
420+
if !reflect.DeepEqual(deployment.Spec.Template.Spec.Tolerations, expectedTolerations) {
421+
t.Errorf("router Deployment has unexpected tolerations, expected: %#v, got: %#v", expectedTolerations, deployment.Spec.Template.Spec.Tolerations)
416422
}
417423
tests := []envData{
418424
{"NAMESPACE_LABELS", true, "foo=bar"},

0 commit comments

Comments
 (0)