{{- if eq .Values.global.platform "openshift" -}}
apiVersion: authorization.openshift.io/v1
kind: Role
metadata:
  labels:
    {{- include "gerrit-operator.labels" . | nindent 4 }}
  name: edp-{{ .Values.name }}
rules:
- apiGroups:
    - '*'
  attributeRestrictions: null
  resources:
    - securitycontextconstraints
  verbs:
    - create
    - delete
    - get
    - list
    - patch
    - update
- apiGroups:
    - '*'
  attributeRestrictions: null
  resources:
    - gerritgroups
    - gerritgroups/status
    - gerritreplicationconfigs
    - gerritreplicationconfigs/status
    - gerrits
    - gerrits/finalizers
    - gerrits/status
  verbs:
    - '*'
- apiGroups:
    - '*'
  attributeRestrictions: null
  resources:
    - events
    - gerritgroupmembers
    - gerritgroupmembers/finalizers
    - gerritgroupmembers/status
    - gerritgroups
    - gerritgroups/status
    - gerritmergerequests
    - gerritmergerequests/finalizers
    - gerritmergerequests/status
    - gerritprojectaccesses
    - gerritprojectaccesses/finalizers
    - gerritprojectaccesses/status
    - gerritprojects
    - gerritprojects/finalizers
    - gerritprojects/status
    - gerritreplicationconfigs
    - gerritreplicationconfigs/status
    - gerrits
    - gerrits/finalizers
    - gerrits/status
    - keycloakclients
    - keycloakclients/finalizers
    - keycloakclients/status
    - keycloakrealms
    - keycloakrealms/status
    - keycloaks
    - keycloaks/status
  verbs:
    - '*'
- apiGroups:
    - coordination.k8s.io
  attributeRestrictions: null
  resources:
    - leases
  verbs:
    - create
    - get
    - list
    - update
{{ end }}
