# helm_charts_mgmt-clusterrole.yaml
{{- if (and .Values.rbac.create .Values.mgmt.enabled) -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    app: {{ template "opa.name" . }}
    chart: {{ template "opa.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
    component: mgmt
  name: {{ template "opa.mgmtfullname" . }}
rules:
{{ toYaml .Values.rbac.rules.cluster | indent 2 }}
{{- end -}}