# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.17.2
  name: integrationkits.camel.apache.org
spec:
  group: camel.apache.org
  names:
    categories:
    - kamel
    - camel
    kind: IntegrationKit
    listKind: IntegrationKitList
    plural: integrationkits
    shortNames:
    - ik
    singular: integrationkit
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - description: The integration kit alias
      jsonPath: .metadata.labels.camel\.apache\.org\/kit\.alias
      name: Alias
      type: string
    - description: The integration kit phase
      jsonPath: .status.phase
      name: Phase
      type: string
    - description: The integration kit type
      jsonPath: .metadata.labels.camel\.apache\.org\/kit\.type
      name: Type
      type: string
    - description: The integration kit layout
      jsonPath: .metadata.labels.camel\.apache\.org\/kit\.layout
      name: Layout
      type: string
    - description: The integration kit image
      jsonPath: .status.image
      name: Image
      type: string
    - description: The integration kit root image
      jsonPath: .status.rootImage
      name: Root
      type: string
    name: v1
    schema:
      openAPIV3Schema:
        description: |-
          IntegrationKit defines a container image and additional configuration needed to run an `Integration`.
          An `IntegrationKit` is a generic image generally built from the requirements of an `Integration`, but agnostic to it,
          in order to be reused by any other `Integration` which has the same required set of capabilities. An `IntegrationKit`
          may be used for other kits as a base container layer, when the `incremental` build option is enabled.
        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: the desired configuration
            properties:
              capabilities:
                description: features offered by the IntegrationKit
                items:
                  type: string
                type: array
              configuration:
                description: |-
                  Deprecated:
                  Use camel trait (camel.properties) to manage properties
                  Use mount trait (mount.configs) to manage configs
                  Use mount trait (mount.resources) to manage resources
                  Use mount trait (mount.volumes) to manage volumes
                  configuration used by the kit
                items:
                  description: ConfigurationSpec represents a generic configuration
                    specification.
                  properties:
                    type:
                      description: 'represents the type of configuration, ie: property,
                        configmap, secret, ...'
                      type: string
                    value:
                      description: the value to assign to the configuration (syntax
                        may vary depending on the `Type`)
                      type: string
                  required:
                  - type
                  - value
                  type: object
                type: array
              dependencies:
                description: a list of Camel dependencies used by this kit
                items:
                  type: string
                type: array
              image:
                description: the container image as identified in the container registry
                type: string
              profile:
                description: the profile which is expected by this kit
                type: string
              repositories:
                description: Maven repositories that can be used by the kit
                items:
                  type: string
                type: array
              sources:
                description: the sources to add at build time
                items:
                  description: SourceSpec defines the configuration for one or more
                    routes to be executed in a certain Camel DSL language.
                  properties:
                    compression:
                      description: if the content is compressed (base64 encrypted)
                      type: boolean
                    content:
                      description: the source code (plain text)
                      type: string
                    contentKey:
                      description: the confimap key holding the source content
                      type: string
                    contentRef:
                      description: the confimap reference holding the source content
                      type: string
                    contentType:
                      description: the content type (tipically text or binary)
                      type: string
                    from-kamelet:
                      description: True if the spec is generated from a Kamelet
                      type: boolean
                    interceptors:
                      description: |-
                        Interceptors are optional identifiers the org.apache.camel.k.RoutesLoader
                        uses to pre/post process sources
                        Deprecated: no longer in use.
                      items:
                        type: string
                      type: array
                    language:
                      description: specify which is the language (Camel DSL) used
                        to interpret this source code
                      type: string
                    loader:
                      description: |-
                        Loader is an optional id of the org.apache.camel.k.RoutesLoader that will
                        interpret this source at runtime
                      type: string
                    name:
                      description: the name of the specification
                      type: string
                    path:
                      description: the path where the file is stored
                      type: string
                    property-names:
                      description: List of property names defined in the source (e.g.
                        if type is "template")
                      items:
                        type: string
                      type: array
                    rawContent:
                      description: the source code (binary)
                      format: byte
                      type: string
                    type:
                      description: Type defines the kind of source described by this
                        object
                      type: string
                  type: object
                type: array
              traits:
                description: traits that the kit will execute
                properties:
                  addons:
                    additionalProperties:
                      description: AddonTrait represents the configuration of an addon
                        trait.
                      type: object
                      x-kubernetes-preserve-unknown-fields: true
                    description: The collection of addon trait configurations
                    type: object
                  builder:
                    description: The builder trait is internally used to determine
                      the best strategy to build and configure IntegrationKits.
                    properties:
                      annotations:
                        additionalProperties:
                          type: string
                        description: When using `pod` strategy, annotation to use
                          for the builder pod.
                        type: object
                      baseImage:
                        description: |-
                          Specify a base image. In order to have the application working properly it must be a container image which has a Java JDK
                          installed and ready to use on path (ie `/usr/bin/java`).
                        type: string
                      configuration:
                        description: |-
                          Legacy trait configuration parameters.
                          Deprecated: for backward compatibility.
                        type: object
                        x-kubernetes-preserve-unknown-fields: true
                      enabled:
                        description: 'Deprecated: no longer in use.'
                        type: boolean
                      incrementalImageBuild:
                        description: Use the incremental image build option, to reuse
                          existing containers (default `true`)
                        type: boolean
                      limitCPU:
                        description: |-
                          When using `pod` strategy, the maximum amount of CPU required by the pod builder.
                          Deprecated: use TasksRequestCPU instead with task name `builder`.
                        type: string
                      limitMemory:
                        description: |-
                          When using `pod` strategy, the maximum amount of memory required by the pod builder.
                          Deprecated: use TasksRequestCPU instead with task name `builder`.
                        type: string
                      mavenProfiles:
                        description: |-
                          A list of references pointing to configmaps/secrets that contains a maven profile.
                          This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit.
                          The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM.
                          Syntax: [configmap|secret]:name[/key], where name represents the resource name, key optionally represents the resource key to be filtered (default key value = profile.xml).
                        items:
                          type: string
                        type: array
                      nodeSelector:
                        additionalProperties:
                          type: string
                        description: Defines a set of nodes the builder pod is eligible
                          to be scheduled on, based on labels on the node.
                        type: object
                      orderStrategy:
                        description: The build order strategy to use, either `dependencies`,
                          `fifo` or `sequential` (default is the platform default)
                        enum:
                        - dependencies
                        - fifo
                        - sequential
                        type: string
                      platforms:
                        description: The list of manifest platforms to use to build
                          a container image (default `linux/amd64`).
                        items:
                          type: string
                        type: array
                      properties:
                        description: A list of properties to be provided to the build
                          task
                        items:
                          type: string
                        type: array
                      requestCPU:
                        description: |-
                          When using `pod` strategy, the minimum amount of CPU required by the pod builder.
                          Deprecated: use TasksRequestCPU instead with task name `builder`.
                        type: string
                      requestMemory:
                        description: |-
                          When using `pod` strategy, the minimum amount of memory required by the pod builder.
                          Deprecated: use TasksRequestCPU instead with task name `builder`.
                        type: string
                      strategy:
                        description: The strategy to use, either `pod` or `routine`
                          (default `routine`)
                        enum:
                        - pod
                        - routine
                        type: string
                      tasks:
                        description: A list of tasks to be executed (available only
                          when using `pod` strategy) with format `<name>;<container-image>;<container-command>`.
                        items:
                          type: string
                        type: array
                      tasksFilter:
                        description: |-
                          A list of tasks sorted by the order of execution in a csv format, ie, `<taskName1>,<taskName2>,...`.
                          Mind that you must include also the operator tasks (`builder`, `quarkus-native`, `package`, `jib`, `s2i`)
                          if you need to execute them. Useful only with `pod` strategy.
                        type: string
                      tasksLimitCPU:
                        description: A list of limit cpu configuration for the specific
                          task with format `<task-name>:<limit-cpu-conf>`.
                        items:
                          type: string
                        type: array
                      tasksLimitMemory:
                        description: A list of limit memory configuration for the
                          specific task with format `<task-name>:<limit-memory-conf>`.
                        items:
                          type: string
                        type: array
                      tasksRequestCPU:
                        description: A list of request cpu configuration for the specific
                          task with format `<task-name>:<request-cpu-conf>`.
                        items:
                          type: string
                        type: array
                      tasksRequestMemory:
                        description: A list of request memory configuration for the
                          specific task with format `<task-name>:<request-memory-conf>`.
                        items:
                          type: string
                        type: array
                      verbose:
                        description: |-
                          Enable verbose logging on build components that support it (e.g. Kaniko build pod).
                          Deprecated no longer in use
                        type: boolean
                    type: object
                  camel:
                    description: The Camel trait sets up Camel configuration.
                    properties:
                      configuration:
                        description: |-
                          Legacy trait configuration parameters.
                          Deprecated: for backward compatibility.
                        type: object
                        x-kubernetes-preserve-unknown-fields: true
                      enabled:
                        description: 'Deprecated: no longer in use.'
                        type: boolean
                      properties:
                        description: A list of properties to be provided to the Integration
                          runtime
                        items:
                          type: string
                        type: array
                      runtimeProvider:
                        description: The runtime provider to use for the integration.
                          (Default, Camel K Runtime).
                        enum:
                        - quarkus
                        - plain-quarkus
                        type: string
                      runtimeVersion:
                        description: |-
                          The runtime version to use for the integration. It overrides the default version set in the Integration Platform.
                          You can use a fixed version (for example "3.2.3") or a semantic version (for example "3.x") which will try to resolve
                          to the best matching Catalog existing on the cluster (Default, the one provided by the operator version).
                        type: string
                    type: object
                  quarkus:
                    description: |-
                      The Quarkus trait configures the Quarkus runtime.
                      It's enabled by default.
                      NOTE: Compiling to a native executable, requires at least 4GiB of memory, so the Pod running the native build must have enough memory available.
                    properties:
                      buildMode:
                        description: |-
                          The Quarkus mode to run: either `jvm` or `native` (default `jvm`).
                          In case both `jvm` and `native` are specified, two `IntegrationKit` resources are created,
                          with the `native` kit having precedence over the `jvm` one once ready.
                        items:
                          description: QuarkusMode is the type of Quarkus build packaging.
                          enum:
                          - jvm
                          - native
                          type: string
                        type: array
                      configuration:
                        description: |-
                          Legacy trait configuration parameters.
                          Deprecated: for backward compatibility.
                        type: object
                        x-kubernetes-preserve-unknown-fields: true
                      enabled:
                        description: 'Deprecated: no longer in use.'
                        type: boolean
                      nativeBaseImage:
                        description: The base image to use when running a native build
                          (default `quay.io/quarkus/quarkus-micro-image:2.0`)
                        type: string
                      nativeBuilderImage:
                        description: The image containing the tooling required for
                          a native build (by default it will use the one provided
                          in the runtime catalog)
                        type: string
                      packageTypes:
                        description: |-
                          The Quarkus package types, `fast-jar` or `native` (default `fast-jar`).
                          In case both `fast-jar` and `native` are specified, two `IntegrationKit` resources are created,
                          with the native kit having precedence over the `fast-jar` one once ready.
                          The order influences the resolution of the current kit for the integration.
                          The kit corresponding to the first package type will be assigned to the
                          integration in case no existing kit that matches the integration exists.
                          Deprecated: use `build-mode` instead.
                        items:
                          description: |-
                            QuarkusPackageType is the type of Quarkus build packaging.
                            Deprecated: use `QuarkusMode` instead.
                          enum:
                          - fast-jar
                          - native
                          type: string
                        type: array
                    type: object
                  registry:
                    description: |-
                      The Registry trait sets up Maven to use the Image registry as a Maven repository (support removed since version 2.5.0).
                      Deprecated: use jvm trait or read documentation.
                    properties:
                      configuration:
                        description: |-
                          Legacy trait configuration parameters.
                          Deprecated: for backward compatibility.
                        type: object
                        x-kubernetes-preserve-unknown-fields: true
                      enabled:
                        description: Can be used to enable or disable a trait. All
                          traits share this common property.
                        type: boolean
                    type: object
                type: object
            type: object
          status:
            description: the actual status
            properties:
              artifacts:
                description: list of artifacts used by the kit
                items:
                  description: Artifact represents a materialized artifact (a jar
                    dependency or in general a file used by the build).
                  properties:
                    checksum:
                      description: a checksum (SHA1) of the content
                      type: string
                    id:
                      description: the identification (GAV for maven dependencies
                        or file name for other file types)
                      type: string
                    location:
                      description: where it is located in the builder `Pod`
                      type: string
                    target:
                      description: the expected location in the runtime
                      type: string
                  required:
                  - id
                  type: object
                type: array
              baseImage:
                description: base image used by the kit (could be another IntegrationKit)
                type: string
              catalog:
                description: the catalog used to build/operate the IntegrationKit.
                properties:
                  provider:
                    description: RuntimeProvider is the provider chosen for the runtime.
                    type: string
                  version:
                    type: string
                type: object
              conditions:
                description: a list of conditions which happened for the events related
                  the kit
                items:
                  description: IntegrationKitCondition describes the state of a resource
                    at a certain point.
                  properties:
                    lastTransitionTime:
                      description: Last time the condition transitioned from one status
                        to another.
                      format: date-time
                      type: string
                    lastUpdateTime:
                      description: The last time this condition was updated.
                      format: date-time
                      type: string
                    message:
                      description: A human-readable message indicating details about
                        the transition.
                      type: string
                    reason:
                      description: The reason for the condition's last transition.
                      type: string
                    status:
                      description: Status of the condition, one of True, False, Unknown.
                      type: string
                    type:
                      description: Type of integration condition.
                      type: string
                  required:
                  - status
                  - type
                  type: object
                type: array
              digest:
                description: actual image digest of the kit
                type: string
              failure:
                description: failure reason (if any)
                properties:
                  reason:
                    description: a short text specifying the reason
                    type: string
                  recovery:
                    description: the recovery attempted for this failure
                    properties:
                      attempt:
                        description: attempt number
                        type: integer
                      attemptMax:
                        description: maximum number of attempts
                        type: integer
                      attemptTime:
                        description: time of the attempt execution
                        format: date-time
                        type: string
                    required:
                    - attempt
                    - attemptMax
                    type: object
                  time:
                    description: the time when the failure has happened
                    format: date-time
                    type: string
                required:
                - reason
                - recovery
                - time
                type: object
              image:
                description: actual image name of the kit
                type: string
              observedGeneration:
                description: ObservedGeneration is the most recent generation observed
                  for this IntegrationKit.
                format: int64
                type: integer
              phase:
                description: phase of the kit
                type: string
              platform:
                description: the platform for which this kit was configured
                type: string
              rootImage:
                description: root image used by the kit (the first image from which
                  the incremental image has started, typically a JDK/JRE base image)
                type: string
              runtimeProvider:
                description: the runtime provider for which this kit was configured
                type: string
              runtimeVersion:
                description: the runtime version for which this kit was configured
                type: string
              version:
                description: the Camel K operator version for which this kit was configured
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
