From 46be93808b7550f08f535ce78507b276f979de86 Mon Sep 17 00:00:00 2001 From: Maikel Date: Thu, 5 Aug 2021 15:23:22 +0200 Subject: [PATCH] Add scope configuration check. (#6864) --- charts/ingress-nginx/templates/clusterrole.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/ingress-nginx/templates/clusterrole.yaml b/charts/ingress-nginx/templates/clusterrole.yaml index 8ec5f49fa..b546aaea2 100644 --- a/charts/ingress-nginx/templates/clusterrole.yaml +++ b/charts/ingress-nginx/templates/clusterrole.yaml @@ -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: @@ -73,3 +79,5 @@ rules: - list - watch {{- end }} + +{{- end }}