Skip to content

Commit 364e653

Browse files
committed
Revert "OSD-16469 - Add all Service Accounts on the IC webhook whitelist"
This reverts commit 2ba2b11.
1 parent 30d190e commit 364e653

File tree

2 files changed

+1
-39
lines changed

2 files changed

+1
-39
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:*`
22+
allowedGroups string = `^system:serviceaccounts:(kube.*|openshift.*|default|redhat.*|osde2e-[a-z0-9]{5})`
2323
)
2424

2525
var (

pkg/webhooks/ingresscontroller/ingresscontroller_test.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -321,44 +321,6 @@ 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-
},
362324
}
363325
runIngressControllerTests(t, tests)
364326
}

0 commit comments

Comments
 (0)