---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: clusterclaims-controller
rules:

# New Rules added to ClusterClaims
# Leader Lock requires configmaps(create&get) and pods(get)
- apiGroups: ["hive.openshift.io"]
  resources: ["clusterclaims","clusterpools"]
  verbs: ["get","list","watch","update","patch"]

- apiGroups: ["hive.openshift.io"]
  resources: ["clusterdeployments"]
  verbs: ["get","list","watch"]

- apiGroups:
  - "cluster.open-cluster-management.io"
  resources:
  - managedclusters
  verbs:
  - get
  - list
  - create
  - delete
  - watch
  - update
  - patch

- apiGroups:
  - "register.open-cluster-management.io"
  resources:
  - managedclusters/accept
  verbs:
  - update

- apiGroups:
  - "cluster.open-cluster-management.io"
  resources:
  - managedclustersets/join
  verbs:
  - create

- apiGroups:
  - ""
  resources:
  - secrets
  - namespaces
  verbs:
  - list
  - get
  - watch
  - delete

# Leader election
- apiGroups:
  - ""
  resources:
  - configmaps
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
- apiGroups:
  - ""
  resources:
  - configmaps/status
  verbs:
  - get
  - update
  - patch
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - create