apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: open-cluster-management:managedcluster:{{ .ManagedClusterName }}:registration
  namespace: "{{ .ManagedClusterName }}"
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: open-cluster-management:managedcluster:registration
subjects:
  # Bind the role with spoke agent user group, the role will be as a common role for all spoke agents
  # TODO: we will consider bind a specific role for each spoke agent by spoke agent name
  - kind: Group
    apiGroup: rbac.authorization.k8s.io
    name: system:open-cluster-management:{{ .ManagedClusterName }}
