apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
  name: p1-local-cluster
  namespace: open-cluster-management-global-set
spec:
  predicates:
  - requiredClusterSelector:
      labelSelector:
        matchExpressions:
        - key: name
          operator: In
          values:
          - local-cluster
---
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
  name: p2-nocluster
  namespace: open-cluster-management-global-set
spec:
  predicates:
  - requiredClusterSelector:
      labelSelector:
        matchExpressions:
        - key: name
          operator: In
          values:
          - nocluster
---
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
  name: p3-unavailable-cluster
  namespace: open-cluster-management-global-set
spec:
  predicates:
  - requiredClusterSelector:
      labelSelector:
        matchExpressions:
        - key: name
          operator: In
          values:
          - mc1
  tolerations:
  - key: cluster.open-cluster-management.io/unreachable
    operator: Equal
  - key: cluster.open-cluster-management.io/unavailable
    operator: Equal
---
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
  name: p4-globalset-with-some-unavailable-clusters
  namespace: open-cluster-management-global-set
spec:
  clusterSets:
  - global
  tolerations:
  - key: cluster.open-cluster-management.io/unreachable
    operator: Equal
  - key: cluster.open-cluster-management.io/unavailable
    operator: Equal
---
apiVersion: rbac.open-cluster-management.io/v1beta1
kind: MulticlusterRoleAssignment
metadata:
  name: matttest1
  namespace: open-cluster-management-global-set
spec:
  subject:
    kind: User
    name: Matt
  roleAssignments:
  - name: ra1
    clusterRole: role1
    clusterSelection:
      type: placements
      placements:
      - name: p1-local-cluster
        namespace: open-cluster-management-global-set
  - name: ra2
    clusterRole: role1
    clusterSelection:
      type: placements
      placements:
      - name: p2-nocluster
        namespace: open-cluster-management-global-set
  - name: ra3
    clusterRole: role1
    targetNamespaces:
    - non-existent-ns
    clusterSelection:
      type: placements
      placements:
      - name: p1-local-cluster
        namespace: open-cluster-management-global-set
  - name: ra4
    clusterRole: role1
    clusterSelection:
      type: placements
      placements:
      - name: non-existent-placement
        namespace: open-cluster-management-global-set
  - name: ra5
    clusterRole: role1
    clusterSelection:
      type: placements
      placements:
      - name: p3-unavailable-cluster
        namespace: open-cluster-management-global-set
  - name: ra6
    clusterRole: role1
    clusterSelection:
      type: placements
      placements:
      - name: p4-globalset-with-some-unavailable-clusters
        namespace: open-cluster-management-global-set