Skip to content

Commit 52426fb

Browse files
committed
Allow customers to schedule custom Ingress Controllers on infra nodes
1 parent 426092e commit 52426fb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/webhooks/ingresscontroller/ingresscontroller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818

1919
const (
2020
WebhookName string = "ingresscontroller-validation"
21-
docString string = `Managed OpenShift Customer may create IngressControllers without necessary taints. This can cause those workloads to be provisioned on infra or master nodes.`
21+
docString string = `Managed OpenShift Customer may create IngressControllers without necessary taints. This can cause those workloads to be provisioned on master nodes.`
2222
legacyIngressSupportFeatureFlag = "ext-managed.openshift.io/legacy-ingress-support"
2323
)
2424

@@ -140,8 +140,8 @@ func (wh *IngressControllerWebhook) authorized(request admissionctl.Request) adm
140140
// Check if the group does not have exceptions
141141
if !isAllowedUser(request) {
142142
for _, toleration := range ic.Spec.NodePlacement.Tolerations {
143-
if strings.Contains(toleration.Key, "node-role.kubernetes.io/master") || strings.Contains(toleration.Key, "node-role.kubernetes.io/infra") {
144-
ret = admissionctl.Denied("Not allowed to provision ingress controller pods with toleration for master and infra nodes.")
143+
if strings.Contains(toleration.Key, "node-role.kubernetes.io/master") {
144+
ret = admissionctl.Denied("Not allowed to provision ingress controller pods with toleration for master nodes.")
145145
ret.UID = request.AdmissionRequest.UID
146146

147147
return ret

pkg/webhooks/ingresscontroller/ingresscontroller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func TestIngressControllerTolerations(t *testing.T) {
173173
Effect: "NoSchedule",
174174
},
175175
},
176-
shouldBeAllowed: false,
176+
shouldBeAllowed: true,
177177
},
178178
{
179179
testID: "toleration-test-create-3",
@@ -224,7 +224,7 @@ func TestIngressControllerTolerations(t *testing.T) {
224224
Effect: "NoSchedule",
225225
},
226226
},
227-
shouldBeAllowed: false,
227+
shouldBeAllowed: true,
228228
},
229229
{
230230
testID: "toleration-test-update-3",

0 commit comments

Comments
 (0)