apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: workshoprequests.training.eduk8s.io
spec:
  scope: Namespaced
  group: training.eduk8s.io
  names:
    plural: workshoprequests
    singular: workshoprequest
    kind: WorkshopRequest
    categories:
    - eduk8s
    - eduk8s-training
  versions:
    - name: v1alpha1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              required:
              - environment
              properties:
                environment:
                  type: object
                  required:
                  - name
                  properties:
                    name:
                      type: string
                    token:
                      type: string
            status:
              type: object
              x-kubernetes-preserve-unknown-fields: true
              properties:
                eduk8s:
                  type: object
                  properties:
                    phase:
                      type: string
                    url:
                      type: string
                    username:
                      type: string
                    password:
                      type: string
                    session:
                      type: object
                      properties:
                        kind:
                          type: string
                        apiVersion:
                          type: string
                        name:
                          type: string
                        uid:
                          type: string
      additionalPrinterColumns:
      - name: URL
        type: string
        priority: 0
        description: The URL to access the workshop.
        jsonPath: .status.eduk8s.url
      - name: Username
        type: string
        priority: 0
        description: The username to access the workshop.
        jsonPath: .status.eduk8s.username
      - name: Password
        type: string
        priority: 0
        description: The password to access the workshop.
        jsonPath: .status.eduk8s.password
      - name: Status
        type: string
        priority: 0
        description: Status of workshop request.
        jsonPath: .status.eduk8s.phase
