{{- if .Values.controller.manager.config.watchSingleNamespace }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: {{ include "gha-controller.manager-single-namespace-watch-role-binding" . }}
  namespace: {{ .Values.controller.manager.config.watchSingleNamespace }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: {{ include "gha-controller.manager-single-namespace-watch-role-name" . }}
subjects:
- kind: ServiceAccount
  name: {{ include "gha-controller.service-account-name" . }}
  namespace: {{ include "gha-controller.namespace" . }}
{{- end }}
