{{- if .Values.rbac.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: {{ include "enmasse.fullname" . }}-address-space-controller
  labels:
{{ include "enmasse.labels" . | indent 4 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: {{ include "enmasse.fullname" . }}-address-space-controller
subjects:
- kind: ServiceAccount
  name: {{ include "enmasse.fullname" . }}-address-space-controller
  namespace: {{.Release.Namespace}}
{{- end }}