This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-helm-chart.git


The following commit(s) were added to refs/heads/master by this push:
     new 1956a87  Fixes #173 Support both Role Binding and Cluster Role Binding 
dependi… (#174)
1956a87 is described below

commit 1956a870ff7bf1c50bcc60f03ae72322e1d8ea70
Author: Frank Kelly <[email protected]>
AuthorDate: Fri Nov 12 10:56:35 2021 -0500

    Fixes #173 Support both Role Binding and Cluster Role Binding dependi… 
(#174)
    
    * Fixes #173 Support both Role Binding and Cluster Role Binding depending 
on rbac.limit_to_namespace
    
    * Rev version
    
    * Get Role/Cluster the right way around
---
 charts/pulsar/Chart.yaml                                |  2 +-
 .../pulsar/templates/broker-cluster-role-binding.yaml   | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/charts/pulsar/Chart.yaml b/charts/pulsar/Chart.yaml
index 4265d63..e628ddd 100644
--- a/charts/pulsar/Chart.yaml
+++ b/charts/pulsar/Chart.yaml
@@ -21,7 +21,7 @@ apiVersion: v1
 appVersion: "2.7.2"
 description: Apache Pulsar Helm chart for Kubernetes
 name: pulsar
-version: 2.7.4
+version: 2.7.5
 home: https://pulsar.apache.org
 sources:
 - https://github.com/apache/pulsar
diff --git a/charts/pulsar/templates/broker-cluster-role-binding.yaml 
b/charts/pulsar/templates/broker-cluster-role-binding.yaml
index d76f9c1..706e1ba 100644
--- a/charts/pulsar/templates/broker-cluster-role-binding.yaml
+++ b/charts/pulsar/templates/broker-cluster-role-binding.yaml
@@ -22,17 +22,24 @@
 apiVersion: rbac.authorization.k8s.io/v1
 {{- if .Values.rbac.limit_to_namespace }}
 kind: RoleBinding
+metadata:
+  name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component 
}}-rolebinding"
 {{- else}}
 kind: ClusterRoleBinding
-{{- end}}
 metadata:
   name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component 
}}-clusterrolebinding"
+{{- end}}
   labels:
     {{- include "pulsar.standardLabels" . | nindent 4 }}
 roleRef:
   apiGroup: rbac.authorization.k8s.io
+{{- if .Values.rbac.limit_to_namespace }}
+  kind: Role
+  name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component 
}}-role"
+{{- else}}
   kind: ClusterRole
   name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component 
}}-clusterrole"
+{{- end}}
 subjects:
 - kind: ServiceAccount
   name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component 
}}-acct"
@@ -40,9 +47,15 @@ subjects:
 ---
 
 apiVersion: rbac.authorization.k8s.io/v1
+{{- if .Values.rbac.limit_to_namespace }}
+kind: Role
+metadata:
+  name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component 
}}-role"
+{{- else}}
 kind: ClusterRole
 metadata:
   name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component 
}}-clusterrole"
+{{- end}}
   labels:
     {{- include "pulsar.standardLabels" . | nindent 4 }}
 rules:
@@ -67,4 +80,4 @@ rules:
     - patch
 ---
 
-{{- end }}
\ No newline at end of file
+{{- end }}

Reply via email to