apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: keptnapps.lifecycle.keptn.sh
  annotations:
    controller-gen.kubebuilder.io/version: v0.16.5
    {{- with .Values.global.caInjectionAnnotations }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  {{- include "common.annotations" (dict "context" .) }}
  labels:
    app.kubernetes.io/part-of: keptn
    crdGroup: lifecycle.keptn.sh
    keptn.sh/inject-cert: "true"
{{- include "common.labels.standard" ( dict "context" . ) | nindent 4 }}
spec:
  conversion:
    strategy: Webhook
    webhook:
      clientConfig:
        service:
          name: 'lifecycle-webhook-service'
          namespace: '{{ .Release.Namespace }}'
          path: /convert
      conversionReviewVersions:
      - v1
  group: lifecycle.keptn.sh
  names:
    kind: KeptnApp
    listKind: KeptnAppList
    plural: keptnapps
    singular: keptnapp
  scope: Namespaced
  versions:
  - name: v1
    schema:
      openAPIV3Schema:
        description: KeptnApp is the Schema for the keptnapps API
        properties:
          apiVersion:
            description: |-
              APIVersion defines the versioned schema of this representation of an object.
              Servers should convert recognized schemas to the latest internal value, and
              may reject unrecognized values.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
            type: string
          kind:
            description: |-
              Kind is a string value representing the REST resource this object represents.
              Servers may infer this from the endpoint the client submits requests to.
              Cannot be updated.
              In CamelCase.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
            type: string
          metadata:
            type: object
          spec:
            description: Spec describes the desired state of the KeptnApp.
            properties:
              revision:
                default: 1
                description: |-
                  Revision can be modified to trigger another deployment of a KeptnApp of the same version.
                  This can be used for restarting a KeptnApp which failed to deploy,
                  e.g. due to a failed preDeploymentEvaluation/preDeploymentTask.
                type: integer
              version:
                description: |-
                  Version defines the version of the application. For automatically created KeptnApps,
                  the version is a function of all KeptnWorkloads that are part of the KeptnApp.
                type: string
              workloads:
                description: Workloads is a list of all KeptnWorkloads that are part
                  of the KeptnApp.
                items:
                  description: KeptnWorkloadRef refers to a KeptnWorkload that is
                    part of a KeptnApp
                  properties:
                    name:
                      description: Name is the name of the KeptnWorkload.
                      type: string
                    version:
                      description: Version is the version of the KeptnWorkload.
                      type: string
                  required:
                  - name
                  - version
                  type: object
                type: array
            required:
            - version
            type: object
          status:
            description: Status describes the current state of the KeptnApp.
            properties:
              currentVersion:
                description: CurrentVersion indicates the version that is currently
                  deployed or being reconciled.
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
  - name: v1alpha1
    schema:
      openAPIV3Schema:
        description: KeptnApp is the Schema for the keptnapps API
        properties:
          apiVersion:
            description: |-
              APIVersion defines the versioned schema of this representation of an object.
              Servers should convert recognized schemas to the latest internal value, and
              may reject unrecognized values.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
            type: string
          kind:
            description: |-
              Kind is a string value representing the REST resource this object represents.
              Servers may infer this from the endpoint the client submits requests to.
              Cannot be updated.
              In CamelCase.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
            type: string
          metadata:
            type: object
          spec:
            description: KeptnAppSpec defines the desired state of KeptnApp
            properties:
              postDeploymentEvaluations:
                items:
                  type: string
                type: array
              postDeploymentTasks:
                items:
                  type: string
                type: array
              preDeploymentEvaluations:
                items:
                  type: string
                type: array
              preDeploymentTasks:
                items:
                  type: string
                type: array
              version:
                type: string
              workloads:
                items:
                  properties:
                    name:
                      type: string
                    version:
                      type: string
                  required:
                  - name
                  - version
                  type: object
                type: array
            required:
            - version
            type: object
          status:
            description: KeptnAppStatus defines the observed state of KeptnApp
            properties:
              currentVersion:
                type: string
            type: object
        type: object
    served: true
    storage: false
    subresources:
      status: {}
  - name: v1alpha2
    schema:
      openAPIV3Schema:
        description: KeptnApp is the Schema for the keptnapps API
        properties:
          apiVersion:
            description: |-
              APIVersion defines the versioned schema of this representation of an object.
              Servers should convert recognized schemas to the latest internal value, and
              may reject unrecognized values.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
            type: string
          kind:
            description: |-
              Kind is a string value representing the REST resource this object represents.
              Servers may infer this from the endpoint the client submits requests to.
              Cannot be updated.
              In CamelCase.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
            type: string
          metadata:
            type: object
          spec:
            description: KeptnAppSpec defines the desired state of KeptnApp
            properties:
              postDeploymentEvaluations:
                items:
                  type: string
                type: array
              postDeploymentTasks:
                items:
                  type: string
                type: array
              preDeploymentEvaluations:
                items:
                  type: string
                type: array
              preDeploymentTasks:
                items:
                  type: string
                type: array
              revision:
                default: 1
                type: integer
              version:
                type: string
              workloads:
                items:
                  properties:
                    name:
                      type: string
                    version:
                      type: string
                  required:
                  - name
                  - version
                  type: object
                type: array
            required:
            - version
            type: object
          status:
            description: KeptnAppStatus defines the observed state of KeptnApp
            properties:
              currentVersion:
                type: string
            type: object
        type: object
    served: true
    storage: false
    subresources:
      status: {}
  - name: v1alpha3
    schema:
      openAPIV3Schema:
        description: KeptnApp is the Schema for the keptnapps API
        properties:
          apiVersion:
            description: |-
              APIVersion defines the versioned schema of this representation of an object.
              Servers should convert recognized schemas to the latest internal value, and
              may reject unrecognized values.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
            type: string
          kind:
            description: |-
              Kind is a string value representing the REST resource this object represents.
              Servers may infer this from the endpoint the client submits requests to.
              Cannot be updated.
              In CamelCase.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
            type: string
          metadata:
            type: object
          spec:
            description: Spec describes the desired state of the KeptnApp.
            properties:
              postDeploymentEvaluations:
                description: |-
                  PostDeploymentEvaluations is a list of all evaluations to be performed
                  during the post-deployment phase of the KeptnApp.
                  The items of this list refer to the names of KeptnEvaluationDefinitions
                  located in the same namespace as the KeptnApp, or in the Keptn namespace.
                items:
                  type: string
                type: array
              postDeploymentTasks:
                description: |-
                  PostDeploymentTasks is a list of all tasks to be performed during the post-deployment phase of the KeptnApp.
                  The items of this list refer to the names of KeptnTaskDefinitions
                  located in the same namespace as the KeptnApp, or in the Keptn namespace.
                items:
                  type: string
                type: array
              preDeploymentEvaluations:
                description: |-
                  PreDeploymentEvaluations is a list of all evaluations to be performed
                  during the pre-deployment phase of the KeptnApp.
                  The items of this list refer to the names of KeptnEvaluationDefinitions
                  located in the same namespace as the KeptnApp, or in the Keptn namespace.
                items:
                  type: string
                type: array
              preDeploymentTasks:
                description: |-
                  PreDeploymentTasks is a list of all tasks to be performed during the pre-deployment phase of the KeptnApp.
                  The items of this list refer to the names of KeptnTaskDefinitions
                  located in the same namespace as the KeptnApp, or in the Keptn namespace.
                items:
                  type: string
                type: array
              revision:
                default: 1
                description: |-
                  Revision can be modified to trigger another deployment of a KeptnApp of the same version.
                  This can be used for restarting a KeptnApp which failed to deploy,
                  e.g. due to a failed preDeploymentEvaluation/preDeploymentTask.
                type: integer
              version:
                description: |-
                  Version defines the version of the application. For automatically created KeptnApps,
                  the version is a function of all KeptnWorkloads that are part of the KeptnApp.
                type: string
              workloads:
                description: Workloads is a list of all KeptnWorkloads that are part
                  of the KeptnApp.
                items:
                  description: KeptnWorkloadRef refers to a KeptnWorkload that is
                    part of a KeptnApp
                  properties:
                    name:
                      description: Name is the name of the KeptnWorkload.
                      type: string
                    version:
                      description: Version is the version of the KeptnWorkload.
                      type: string
                  required:
                  - name
                  - version
                  type: object
                type: array
            required:
            - version
            type: object
          status:
            description: Status describes the current state of the KeptnApp.
            properties:
              currentVersion:
                description: CurrentVersion indicates the version that is currently
                  deployed or being reconciled.
                type: string
            type: object
        type: object
    served: true
    storage: false
    subresources:
      status: {}
  - name: v1beta1
    schema:
      openAPIV3Schema:
        description: KeptnApp is the Schema for the keptnapps API
        properties:
          apiVersion:
            description: |-
              APIVersion defines the versioned schema of this representation of an object.
              Servers should convert recognized schemas to the latest internal value, and
              may reject unrecognized values.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
            type: string
          kind:
            description: |-
              Kind is a string value representing the REST resource this object represents.
              Servers may infer this from the endpoint the client submits requests to.
              Cannot be updated.
              In CamelCase.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
            type: string
          metadata:
            type: object
          spec:
            description: Spec describes the desired state of the KeptnApp.
            properties:
              revision:
                default: 1
                description: |-
                  Revision can be modified to trigger another deployment of a KeptnApp of the same version.
                  This can be used for restarting a KeptnApp which failed to deploy,
                  e.g. due to a failed preDeploymentEvaluation/preDeploymentTask.
                type: integer
              version:
                description: |-
                  Version defines the version of the application. For automatically created KeptnApps,
                  the version is a function of all KeptnWorkloads that are part of the KeptnApp.
                type: string
              workloads:
                description: Workloads is a list of all KeptnWorkloads that are part
                  of the KeptnApp.
                items:
                  description: KeptnWorkloadRef refers to a KeptnWorkload that is
                    part of a KeptnApp
                  properties:
                    name:
                      description: Name is the name of the KeptnWorkload.
                      type: string
                    version:
                      description: Version is the version of the KeptnWorkload.
                      type: string
                  required:
                  - name
                  - version
                  type: object
                type: array
            required:
            - version
            type: object
          status:
            description: Status describes the current state of the KeptnApp.
            properties:
              currentVersion:
                description: CurrentVersion indicates the version that is currently
                  deployed or being reconciled.
                type: string
            type: object
        type: object
    served: true
    storage: false
    subresources:
      status: {}
