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