apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: '{{ .Values.org }}:{{ .Chart.Name }}:managed-serviceaccount'
rules:
- apiGroups:
  - cluster.open-cluster-management.io
  resources:
  - managedclusters
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - addon.open-cluster-management.io
  resources:
  - clustermanagementaddons
  - managedclusteraddons
  - clustermanagementaddons/status
  - managedclusteraddons/status
  - managedclusteraddons/finalizers
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
- apiGroups:
  - authentication.open-cluster-management.io
  resources:
  - managedserviceaccounts
  - managedserviceaccounts/status
  verbs:
  - get
  - list
  - watch
  - update
  - patch
  - delete
- apiGroups:
  - certificates.k8s.io
  resources:
  - certificatesigningrequests
  - certificatesigningrequests/approval
  - certificatesigningrequests/status
  verbs:
  - get
  - list
  - watch
  - update
  - patch
- apiGroups:
  - certificates.k8s.io
  resourceNames:
  - kubernetes.io/kube-apiserver-client
  resources:
  - signers
  verbs:
  - '*'
- apiGroups:
  - ''
  resources:
  - secrets
  - events
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
- apiGroups:
  - rbac.authorization.k8s.io
  resources:
  - roles
  - rolebindings
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
- apiGroups:
  - work.open-cluster-management.io
  resources:
  - manifestworks
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
- apiGroups:
  - ''
  resources:
  - configmaps
  - secrets
  verbs:
  - '*'
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  verbs:
  - '*'
