apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: decisionversions.operator.baaas
spec:
  group: operator.baaas
  names:
    kind: DecisionVersion
    listKind: DecisionVersionList
    plural: decisionversions
    singular: decisionversion
    categories:
      - all
      - baaas
  scope: Namespaced
  versions:
    - name: v1alpha1
      served: true
      storage: true
      subresources:
        status: {}
      additionalPrinterColumns:
        - name: Ready
          type: string
          description: Ready
          jsonPath: .status.conditions[?(@.type=='Ready')].status
        - name: Build
          type: string
          description: Build status
          jsonPath: .status.conditions[?(@.type=='Build')].reason
        - name: Service
          type: string
          description: Kogito Service status
          jsonPath: .status.conditions[?(@.type=='Service')].reason
      schema:
        openAPIV3Schema:
          type: object
          properties:
            status:
              type: object
              properties:
                pipelineRef:
                  type: string
                imageRef:
                  type: string
                kogitoServiceRef:
                  type: string
                endpoint:
                  type: string
                conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      lastTransitionTime:
                        type: string
                      message:
                        type: string
                      reason:
                        type: string
                      status:
                        type: string
                      type:
                        type: string
                    required:
                      - status
                      - type
            spec:
              type: object
              required:
                - version
                - source
              properties:
                version:
                  type: string
                source:
                  type: string
                kafka:
                  type: object
                  required:
                    - bootstrapServers
                    - secretName
                    - inputTopic
                    - outputTopic
                  properties:
                    bootstrapServers:
                      type: string
                    secretName:
                      type: string
                    inputTopic:
                      type: string
                    outputTopic:
                      type: string
                env:
                  type: object