# helm_charts_consul-test-clusterrolebinding.yaml
{{- if .Values.test.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  labels:
    app: {{ template "consul.name" . }}
    chart: {{ template "consul.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
  name: {{ template "consul.fullname" . }}-test
subjects:
  - kind: ServiceAccount
    name: {{ template "consul.fullname" . }}-test
    namespace: {{ .Release.Namespace }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ template "consul.fullname" . }}-test
{{- end }}