apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: placementdecisions.cluster.open-cluster-management.io
spec:
  conversion:
    strategy: None
  group: cluster.open-cluster-management.io
  names:
    kind: PlacementDecision
    listKind: PlacementDecisionList
    plural: placementdecisions
    singular: placementdecision
  scope: Namespaced
  versions:
    - name: v1alpha1
      schema:
        openAPIV3Schema:
          description: "PlacementDecision indicates a decision from a placement PlacementDecision
          should has a label cluster.open-cluster-management.io/placement={placement
          name} to reference a certain placement. \n If a placement has spec.numberOfClusters
          specified, the total number of decisions contained in status.decisions of
          PlacementDecisions should always be NumberOfClusters; otherwise, the total
          number of decisions should be the number of ManagedClusters which match
          the placement requirements. \n Some of the decisions might be empty when
          there are no enough ManagedClusters meet the placement requirements."
          properties:
            apiVersion:
              description: 'APIVersion defines the versioned schema of this representation
              of an object. Servers should convert recognized schemas to the latest
              internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
              type: string
            kind:
              description: 'Kind is a string value representing the REST resource this
              object represents. Servers may infer this from the endpoint the client
              submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
              type: string
            metadata:
              type: object
            status:
              description: Status represents the current status of the PlacementDecision
              properties:
                decisions:
                  description: Decisions is a slice of decisions according to a placement
                    The number of decisions should not be larger than 100
                  items:
                    description: ClusterDecision represents a decision from a placement
                      An empty ClusterDecision indicates it is not scheduled yet.
                    properties:
                      clusterName:
                        description: ClusterName is the name of the ManagedCluster.
                          If it is not empty, its value should be unique cross all placement
                          decisions for the Placement.
                        type: string
                      reason:
                        description: Reason represents the reason why the ManagedCluster
                          is selected.
                        type: string
                    required:
                      - clusterName
                      - reason
                    type: object
                  type: array
              required:
                - decisions
              type: object
          type: object
      served: true
      storage: true
      subresources:
        status: {}
status:
  acceptedNames:
    kind: PlacementDecision
    listKind: PlacementDecisionList
    plural: placementdecisions
    singular: placementdecision
  conditions:
    - lastTransitionTime: "2021-08-04T08:37:09Z"
      message: no conflicts found
      reason: NoConflicts
      status: "True"
      type: NamesAccepted
    - lastTransitionTime: "2021-08-04T08:37:09Z"
      message: the initial names have been accepted
      reason: InitialNamesAccepted
      status: "True"
      type: Established
  storedVersions:
    - v1alpha1