Add templates of role name and namespace
@@ -41,3 +41,21 @@ Create the name of the cf-operator service account to use
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
+
+{{/*
+Name of the role of cf-operator.
+*/}}
+{{- define "cf-operator.role-name" -}}
+{{- printf "%s-%s" .Chart.Name .Release.Namespace | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Namespace of the cf-operator role.
+*/}}
+{{- define "cf-operator.roleNamespace" -}}
+{{- if .Values.global.operator.watchNamespace }}
+ namespace: {{ .Values.global.operator.watchNamespace }}
+{{- else}}
+ namespace: {{ .Release.Namespace }}
+{{- end }}
+{{- end -}}
