{{ if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/{{ required "A valid .Values.rbac.apiVersion entry required!" .Values.rbac.apiVersion }}
kind: ClusterRoleBinding
metadata:
  name: {{ include "app.fullname" $ }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ .Values.rbac.roleRef | default (printf "%s" (include "app.fullname" $))}}
subjects:
- kind: ServiceAccount
  name: {{ include "app.fullname" $ }}
  namespace: {{ $.Release.Namespace }}
{{ end }}


{{ if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/{{ required "A valid .Values.rbac.apiVersion entry required!" .Values.rbac.apiVersion }}
kind: ClusterRoleBinding
metadata:
  name: {{ include "app.fullname" $ }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ .Values.rbac.roleRef | default (printf "%s" (include "app.fullname" $))}}
subjects:
- kind: ServiceAccount
  name: {{ include "app.fullname" $ }}
  namespace: {{ $.Release.Namespace }}
{{ end }}



Fix no newline at end of file
Fix no newline at end of file
