{{- if eq .Values.tenancyEngine "none" -}}
{{- if eq .Values.global.platform "kubernetes" -}}
{{- if .Values.manageNamespace -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    {{- include "cd-pipeline-operator.labels" . | nindent 4 }}
  name: edp-{{ .Values.name }}-{{ .Release.Namespace }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: edp-{{ .Values.name }}-{{ .Release.Namespace }}
subjects:
  - kind: ServiceAccount
    name: edp-{{ .Values.name }}
    namespace: {{ .Release.Namespace }}
{{- end -}}
{{- end -}}
{{- end -}}
