{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}

{{ if and .Values.rbac.create (ne .Values.scope "namespaced") .Values.features.scheduler }}
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
kind: ClusterRole
metadata:
  name: {{ printf "%s-scheduler" (include "common.names.fullname.namespace" .) | trunc 63 | trimSuffix "-" }}
  labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
    app.kubernetes.io/part-of: kube-arangodb
    app.kubernetes.io/component: operator
rules:
  - apiGroups: ["apiextensions.k8s.io"]
    resources: ["customresourcedefinitions"]
    verbs: ["get", "list", "watch"]
{{- end }}