{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  labels:
    app: {{ template "xray.name" . }}
    chart: {{ template "xray.chart" . }}
    release: {{ .Release.Name | quote }}
    heritage: {{ .Release.Service | quote }}
  name: {{ template "xray.fullname" . }}
rules:
{{ toYaml .Values.rbac.role.rules }}
{{- end }}
