Skip to content

Commit

Permalink
Add scope configuration check. (kubernetes#6864)
Browse files Browse the repository at this point in the history
  • Loading branch information
maikelvl authored and rchshld committed May 17, 2023
1 parent 26ed672 commit 4cc87a2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion charts/ingress-nginx/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{{- if and .Values.rbac.create (not .Values.rbac.scope) -}}
{{- if .Values.rbac.create }}

{{- if and .Values.rbac.scope (not .Values.controller.scope.enabled) -}}
{{ required "Invalid configuration: 'rbac.scope' should be equal to 'controller.scope.enabled' (true/false)." (index (dict) ".") }}
{{- end }}

{{- if not .Values.rbac.scope -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -73,3 +79,5 @@ rules:
- list
- watch
{{- end }}

{{- end }}

0 comments on commit 4cc87a2

Please sign in to comment.