From 61a870c3ca5cdd706c41327bcf931b51ca73f465 Mon Sep 17 00:00:00 2001 From: Arthur Le Roux Date: Wed, 15 May 2024 17:56:58 +0200 Subject: [PATCH] fix(kiali-server): don't create unused ClusterRole Signed-off-by: Arthur Le Roux --- kiali-server/templates/role-viewer.yaml | 2 ++ kiali-server/templates/role.yaml | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/kiali-server/templates/role-viewer.yaml b/kiali-server/templates/role-viewer.yaml index e595439..0811b20 100644 --- a/kiali-server/templates/role-viewer.yaml +++ b/kiali-server/templates/role-viewer.yaml @@ -1,3 +1,4 @@ +{{- if or (.Values.deployment.view_only_mode) (ne .Values.auth.strategy "anonymous") -}} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -92,3 +93,4 @@ rules: verbs: - get ... +{{- end -}} diff --git a/kiali-server/templates/role.yaml b/kiali-server/templates/role.yaml index c47d2d7..de23cc5 100644 --- a/kiali-server/templates/role.yaml +++ b/kiali-server/templates/role.yaml @@ -1,3 +1,4 @@ +{{- if not (or (.Values.deployment.view_only_mode) (ne .Values.auth.strategy "anonymous")) -}} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -59,7 +60,7 @@ rules: - security.istio.io - extensions.istio.io - telemetry.istio.io - - gateway.networking.k8s.io + - gateway.networking.k8s.io resources: ["*"] verbs: - get @@ -99,3 +100,4 @@ rules: verbs: - get ... +{{- end -}}