{{- if eq .Values.global.platform "openshift" -}}
apiVersion: authorization.openshift.io/v1
kind: ClusterRoleBinding
metadata:
  name: {{ .Values.name }}-{{ .Release.Namespace }}
roleRef:
  name: {{ .Values.name }}-{{ .Release.Namespace }}-clusterrole
subjects:
  - kind: ServiceAccount
    name: {{ .Values.name }}
    namespace: {{ .Release.Namespace }}
userNames:
  - system:serviceaccount:{{ .Release.Namespace }}:{{ .Values.name }}
groupNames: []
{{- end -}}