apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: sessions.training.eduk8s.io
spec:
  group: training.eduk8s.io
  versions:
    - name: v1alpha1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              required:
              - vendor
              - title
              - description
              - url
              - image
              properties:
                vendor:
                  type: string
                title:
                  type: string
                description:
                  type: string
                url:
                  type: string
                image:
                  type: string
                budget:
                  type: string
                timeout:
                  x-kubernetes-int-or-string: true
                  anyOf:
                  - type: integer
                  - type: string
                  pattern: '^\d+(s|m|h)?$'
                duration:
                  x-kubernetes-int-or-string: true
                  anyOf:
                  - type: integer
                  - type: string
                  pattern: '^\d+(s|m|h)?$'
      additionalPrinterColumns:
      - name: Image
        type: string
        priority: 0
        description: The location of the image for the workshop.
        jsonPath: .spec.image
      - name: URL
        type: string
        priority: 0
        description: URL for further information on the workshop.
        jsonPath: .spec.url
  scope: Cluster
  names:
    plural: sessions
    singular: session
    kind: Session
