diff --git a/packaging/helm-charts/helm3/strimzi-kafka-operator/templates/020-RoleBinding-strimzi-cluster-operator.yaml b/packaging/helm-charts/helm3/strimzi-kafka-operator/templates/020-RoleBinding-strimzi-cluster-operator.yaml index 630ba6d739b..dae5166d683 100644 --- a/packaging/helm-charts/helm3/strimzi-kafka-operator/templates/020-RoleBinding-strimzi-cluster-operator.yaml +++ b/packaging/helm-charts/helm3/strimzi-kafka-operator/templates/020-RoleBinding-strimzi-cluster-operator.yaml @@ -1,6 +1,10 @@ {{- if .Values.rbac.create -}} {{- $root := . -}} -{{- range append .Values.watchNamespaces .Release.Namespace }} +{{- $watchNamespaces := .Values.watchNamespaces -}} +{{- if $root.Values.watchAnyNamespace }} + {{- $watchNamespaces = list -}} +{{- end }} +{{- range append $watchNamespaces .Release.Namespace }} --- apiVersion: rbac.authorization.k8s.io/v1 {{- if $root.Values.watchAnyNamespace }} diff --git a/packaging/helm-charts/helm3/strimzi-kafka-operator/templates/023-RoleBinding-strimzi-cluster-operator.yaml b/packaging/helm-charts/helm3/strimzi-kafka-operator/templates/023-RoleBinding-strimzi-cluster-operator.yaml index 2eacd13d094..57cac997f9d 100644 --- a/packaging/helm-charts/helm3/strimzi-kafka-operator/templates/023-RoleBinding-strimzi-cluster-operator.yaml +++ b/packaging/helm-charts/helm3/strimzi-kafka-operator/templates/023-RoleBinding-strimzi-cluster-operator.yaml @@ -1,6 +1,10 @@ -{{- if .Values.rbac.create }} +{{- if .Values.rbac.create -}} {{- $root := . -}} -{{- range append .Values.watchNamespaces .Release.Namespace }} +{{- $watchNamespaces := .Values.watchNamespaces -}} +{{- if $root.Values.watchAnyNamespace }} + {{- $watchNamespaces = list -}} +{{- end }} +{{- range append $watchNamespaces .Release.Namespace }} --- apiVersion: rbac.authorization.k8s.io/v1 {{- if $root.Values.watchAnyNamespace }} diff --git a/packaging/helm-charts/helm3/strimzi-kafka-operator/templates/031-RoleBinding-strimzi-cluster-operator-entity-operator-delegation.yaml b/packaging/helm-charts/helm3/strimzi-kafka-operator/templates/031-RoleBinding-strimzi-cluster-operator-entity-operator-delegation.yaml index 1d5e31510ee..f222a4b0a09 100644 --- a/packaging/helm-charts/helm3/strimzi-kafka-operator/templates/031-RoleBinding-strimzi-cluster-operator-entity-operator-delegation.yaml +++ b/packaging/helm-charts/helm3/strimzi-kafka-operator/templates/031-RoleBinding-strimzi-cluster-operator-entity-operator-delegation.yaml @@ -1,6 +1,10 @@ -{{- if .Values.rbac.create }} +{{- if .Values.rbac.create -}} {{- $root := . -}} -{{- range append .Values.watchNamespaces .Release.Namespace }} +{{- $watchNamespaces := .Values.watchNamespaces -}} +{{- if $root.Values.watchAnyNamespace }} + {{- $watchNamespaces = list -}} +{{- end }} +{{- range append $watchNamespaces .Release.Namespace }} --- apiVersion: rbac.authorization.k8s.io/v1 {{- if $root.Values.watchAnyNamespace }}