apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: oaatgroups.kawaja.net
spec:
  scope: Namespaced
  group: kawaja.net
  names:
    kind: OaatGroup
    plural: oaatgroups
    singular: oaatgroup
    shortNames:
      - og
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                frequency:
                  type: string
                failureCooloff:
                  type: string
                windows:
                  type: array
                  items:
                    type: object
                    properties:
                      noStartItem:
                        type: object
                        properties:
                          start:
                            type: object
                            properties:
                              time:
                                type: string
                          end:
                            type: object
                            properties:
                              time:
                                type: string
                oaatType:
                  type: string
                oaatItems:
                  type: array
                  items:
                    type: string
            status:
              type: object
              x-kubernetes-preserve-unknown-fields: true
      additionalPrinterColumns:
        - name: LastRun
          type: date
          priority: 0
          jsonPath: .status.oaat_timer.last_run
          description: Time of most recent attempt.
        - name: Loops
          type: integer
          jsonPath: .status.oaat_timer.loops
          description: Number of loops the daemon has processed.
        - name: State
          type: string
          priority: 0
          jsonPath: .status.state
          description: State of oaat operator.
        - name: CurrentlyRunning
          type: string
          priority: 0
          jsonPath: .status.currently_running
          description: Name of item which is currently running.
        - name: Pod
          type: string
          priority: 0
          jsonPath: .status.pod
          description: Name of pod for the item which is currently running.
        - name: Message
          type: string
          priority: 0
          jsonPath: .status.oaat_timer.message
          description: As returned from the handler (sometimes).
