{{ if .Values.enabledComponents.dgxcAdmissionController }}
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: {{ .Values.dgxcController.name }}
subjects:
  - kind: ServiceAccount
    name: {{ .Values.serviceAccount.name }}
    namespace: {{ .Release.Namespace }}
roleRef:
  kind: ClusterRole
  name: {{ .Values.dgxcController.name }}
  apiGroup: rbac.authorization.k8s.io
{{ end }}
