apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: {{ .ManagedClusterName }}:managed-cluster-registration
  namespace: {{ .ManagedClusterName }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: {{ .ManagedClusterName }}:managed-cluster-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 }}
