Skip to content

Commit 30d190e

Browse files
Merge pull request openshift#233 from Tafhim/OSD-16469-whitelist-all-sa-for-ic-webhook
OSD-16469 - Add all Service Accounts on the IC webhook whitelist
2 parents d203c11 + 2ba2b11 commit 30d190e

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

pkg/webhooks/ingresscontroller/ingresscontroller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
const (
2020
WebhookName string = "ingresscontroller-validation"
2121
docString string = `Managed OpenShift Customer may create IngressControllers without necessary taints. This can cause those workloads to be provisioned on infra or master nodes.`
22-
allowedGroups string = `^system:serviceaccounts:(kube.*|openshift.*|default|redhat.*|osde2e-[a-z0-9]{5})`
22+
allowedGroups string = `^system:serviceaccounts:*`
2323
)
2424

2525
var (

pkg/webhooks/ingresscontroller/ingresscontroller_test.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,44 @@ func TestIngressControllerExceptions(t *testing.T) {
321321
},
322322
shouldBeAllowed: true,
323323
},
324+
{
325+
testID: "exception-test-create-hive",
326+
name: "shiny-newingress",
327+
namespace: "openshift-ingress-operator",
328+
username: "anywho",
329+
userGroups: []string{"system:serviceaccounts:hive"},
330+
operation: admissionv1.Create,
331+
nodeSelector: corev1.NodeSelector{
332+
NodeSelectorTerms: []corev1.NodeSelectorTerm{},
333+
},
334+
tolerations: []corev1.Toleration{
335+
{
336+
Key: "node-role.kubernetes.io/infra",
337+
Operator: "Exists",
338+
Effect: "NoSchedule",
339+
},
340+
},
341+
shouldBeAllowed: true,
342+
},
343+
{
344+
testID: "exception-test-update-hive",
345+
name: "shiny-newingress",
346+
namespace: "openshift-ingress-operator",
347+
username: "anywho",
348+
userGroups: []string{"system:serviceaccounts:hive"},
349+
operation: admissionv1.Update,
350+
nodeSelector: corev1.NodeSelector{
351+
NodeSelectorTerms: []corev1.NodeSelectorTerm{},
352+
},
353+
tolerations: []corev1.Toleration{
354+
{
355+
Key: "node-role.kubernetes.io/infra",
356+
Operator: "Exists",
357+
Effect: "NoSchedule",
358+
},
359+
},
360+
shouldBeAllowed: true,
361+
},
324362
}
325363
runIngressControllerTests(t, tests)
326364
}

0 commit comments

Comments
 (0)