apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: catsforadoption.operator.example.com
spec:
  group: operator.example.com
  scope: Namespaced
  preserveUnknownFields: false
  versions:
    - name: v1alpha1
      served: true
      storage: true
      subresources:
        status: { }
      additionalPrinterColumns:
        - jsonPath: .status.conditions[?(@.type=="Ready")].status
          name: Ready
          type: string
        - jsonPath: .status.conditions[?(@.type=="Ready")].reason
          name: Reason
          type: string
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                name:
                  type: string
                  description: The name of the cat
                dateOfBirth:
                  type: string
                  format: date
                  description: Date of birth of the cat in the format defined in RFC 3339, e.g. 2018-03-20
                description:
                  type: string
                  description: The description of the cat
                adoptionCenterName:
                  type: string
                  description: Name of the adoption center to register this cat to
              required: ["adoptionCenterName", "name"]
            status:
              type: object
              properties:
                conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        description: The unique identifier of a condition, used to distinguish between other conditions in the resource.
                      status:
                        type: string
                        description: The status of the condition, either True, False or Unknown.
                      lastTransitionTime:
                        type: string
                        description: Last time the condition of a type changed from one status to another. The required format is 'yyyy-MM-ddTHH:mm:ssZ', in the UTC time zone.
                      reason:
                        type: string
                        description: The reason for the condition's last transition (a single word in CamelCase).
                  description: List of status conditions.
  names:
    plural: catsforadoption
    singular: catforadoption
    kind: CatForAdoption
    shortNames:
      - cat
      - cats
