You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/05/24 13:50:22 UTC
[camel-k] 01/09: feat(api): rename BuildSpec to PipelineSpec
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit bb355e00dc2f084e533787ea825ac5042821a7a0
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Wed May 17 12:47:03 2023 +0200
feat(api): rename BuildSpec to PipelineSpec
Step required to prepare Camel K to manage a generic pipeline
Ref #4281
---
.../duck/client/internalclientset/fake/register.go | 14 +-
.../client/internalclientset/scheme/register.go | 14 +-
config/crd/bases/camel.apache.org_builds.yaml | 102 ++--
.../camel.apache.org_integrationplatforms.yaml | 530 ++++++++++++++++++++-
.../bases/camel_v1_integrationplatform.yaml | 2 +-
.../architecture/cr/integration-platform.adoc | 4 +-
.../ROOT/pages/installation/advanced/maven.adoc | 12 +-
.../installation/advanced/multi-architecture.adoc | 6 +-
.../ROOT/pages/installation/registry/registry.adoc | 4 +-
docs/modules/ROOT/partials/apis/camel-k-crds.adoc | 289 ++++++++---
e2e/builder/build_test.go | 6 +-
e2e/commonwithcustominstall/builder_test.go | 2 +-
.../catalog_builder_test.go | 2 +-
e2e/commonwithcustominstall/local_platform_test.go | 30 +-
e2e/install/cli/install_test.go | 6 +-
e2e/native/native_binding_test.go | 2 +-
e2e/native/native_with_sources_test.go | 2 +-
e2e/support/test_support.go | 6 +-
helm/camel-k/crds/crd-build.yaml | 102 ++--
helm/camel-k/crds/crd-integration-platform.yaml | 530 ++++++++++++++++++++-
pkg/apis/camel/v1/build_types.go | 44 +-
pkg/apis/camel/v1/build_types_support.go | 29 +-
pkg/apis/camel/v1/common_types.go | 4 +
pkg/apis/camel/v1/integrationplatform_types.go | 41 +-
.../camel/v1/integrationplatform_types_support.go | 8 +-
pkg/apis/camel/v1/zz_generated.deepcopy.go | 105 +++-
pkg/builder/builder_test.go | 2 +-
.../camel/applyconfiguration/camel/v1/build.go | 6 +-
.../camel/v1/buildconfiguration.go | 28 +-
.../applyconfiguration/camel/v1/buildertask.go | 23 +-
.../camel/v1/integrationplatformpipelinespec.go | 141 ++++++
.../camel/v1/integrationplatformspec.go | 21 +-
.../camel/v1/integrationplatformstatus.go | 8 +
.../applyconfiguration/camel/v1/pipelinespec.go | 58 +++
.../camel/applyconfiguration/camel/v1/task.go | 9 +
.../camel/applyconfiguration/camel/v1/usertask.go | 58 +++
pkg/client/camel/applyconfiguration/utils.go | 8 +-
.../camel/clientset/versioned/fake/register.go | 14 +-
.../camel/clientset/versioned/scheme/register.go | 14 +-
pkg/cmd/describe_platform.go | 8 +-
pkg/cmd/install.go | 50 +-
pkg/cmd/promote_test.go | 14 +-
pkg/cmd/run.go | 10 +-
pkg/cmd/run_test.go | 2 +-
pkg/cmd/version.go | 8 +-
pkg/cmd/version_test.go | 4 +-
pkg/controller/build/build_controller.go | 8 +-
pkg/controller/build/build_monitor_test.go | 20 +-
pkg/controller/build/build_pod.go | 4 +-
pkg/controller/catalog/initialize.go | 6 +-
pkg/controller/integrationkit/build.go | 23 +-
pkg/controller/integrationplatform/initialize.go | 6 +-
.../integrationplatform/initialize_test.go | 10 +-
pkg/controller/integrationplatform/kaniko_cache.go | 6 +-
pkg/install/operator.go | 10 +-
pkg/platform/defaults.go | 181 ++++---
pkg/platform/defaults_test.go | 37 +-
pkg/trait/builder.go | 38 +-
pkg/trait/builder_test.go | 24 +-
pkg/trait/camel.go | 8 +-
pkg/trait/container_probes_test.go | 2 +-
pkg/trait/container_test.go | 10 +-
pkg/trait/cron_test.go | 8 +-
pkg/trait/environment_test.go | 2 +-
pkg/trait/istio_test.go | 2 +-
pkg/trait/knative_service_test.go | 10 +-
pkg/trait/knative_test.go | 6 +-
pkg/trait/logging_test.go | 2 +-
pkg/trait/mount_test.go | 2 +-
pkg/trait/openapi.go | 10 +-
pkg/trait/pull_secret.go | 2 +-
pkg/trait/quarkus.go | 6 +-
pkg/trait/quarkus_test.go | 4 +-
pkg/trait/registry.go | 10 +-
pkg/trait/route_test.go | 2 +-
pkg/trait/service_test.go | 14 +-
pkg/trait/trait_test.go | 2 +-
pkg/trait/trait_types.go | 2 +-
78 files changed, 2249 insertions(+), 610 deletions(-)
diff --git a/addons/strimzi/duck/client/internalclientset/fake/register.go b/addons/strimzi/duck/client/internalclientset/fake/register.go
index 53a4309e7..e6ac15499 100644
--- a/addons/strimzi/duck/client/internalclientset/fake/register.go
+++ b/addons/strimzi/duck/client/internalclientset/fake/register.go
@@ -38,14 +38,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
-// import (
-// "k8s.io/client-go/kubernetes"
-// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
-// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
-// )
+// import (
+// "k8s.io/client-go/kubernetes"
+// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
+// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
+// )
//
-// kclientset, _ := kubernetes.NewForConfig(c)
-// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
+// kclientset, _ := kubernetes.NewForConfig(c)
+// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
diff --git a/addons/strimzi/duck/client/internalclientset/scheme/register.go b/addons/strimzi/duck/client/internalclientset/scheme/register.go
index 11f233b92..6abeca247 100644
--- a/addons/strimzi/duck/client/internalclientset/scheme/register.go
+++ b/addons/strimzi/duck/client/internalclientset/scheme/register.go
@@ -38,14 +38,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
-// import (
-// "k8s.io/client-go/kubernetes"
-// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
-// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
-// )
+// import (
+// "k8s.io/client-go/kubernetes"
+// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
+// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
+// )
//
-// kclientset, _ := kubernetes.NewForConfig(c)
-// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
+// kclientset, _ := kubernetes.NewForConfig(c)
+// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
diff --git a/config/crd/bases/camel.apache.org_builds.yaml b/config/crd/bases/camel.apache.org_builds.yaml
index 70e54e1dd..d24d8135b 100644
--- a/config/crd/bases/camel.apache.org_builds.yaml
+++ b/config/crd/bases/camel.apache.org_builds.yaml
@@ -77,44 +77,8 @@ spec:
metadata:
type: object
spec:
- description: BuildSpec defines the Build operation to be executed
+ description: PipelineSpec defines the Build operation to be executed
properties:
- configuration:
- description: The configuration that should be used to perform the
- Build.
- properties:
- limitCPU:
- description: The maximum amount of CPU required. Only used for
- `pod` strategy
- type: string
- limitMemory:
- description: The maximum amount of memory required. Only used
- for `pod` strategy
- type: string
- requestCPU:
- description: The minimum amount of CPU required. Only used for
- `pod` strategy
- type: string
- requestMemory:
- description: The minimum amount of memory required. Only used
- for `pod` strategy
- type: string
- strategy:
- description: the strategy to adopt
- enum:
- - routine
- - pod
- type: string
- type: object
- maxRunningBuilds:
- description: the maximum amount of parallel running builds started
- by this operator instance
- format: int32
- type: integer
- operatorNamespace:
- description: The namespace where to run the builder Pod (must be the
- same of the operator in charge of this Build reconciliation).
- type: string
tasks:
description: The sequence of Build tasks to be performed as part of
the Build execution.
@@ -169,7 +133,8 @@ spec:
type: boolean
type: object
builder:
- description: a BuilderTask (base task)
+ description: a BuilderTask, used to generate and package the
+ project
properties:
baseImage:
description: the base image layer
@@ -177,6 +142,42 @@ spec:
buildDir:
description: workspace directory to use
type: string
+ configuration:
+ description: The configuration that should be used to perform
+ the Build.
+ properties:
+ limitCPU:
+ description: The maximum amount of CPU required. Only
+ used for `pod` strategy
+ type: string
+ limitMemory:
+ description: The maximum amount of memory required.
+ Only used for `pod` strategy
+ type: string
+ operatorNamespace:
+ description: The namespace where to run the builder
+ Pod (must be the same of the operator in charge of
+ this Build reconciliation).
+ type: string
+ requestCPU:
+ description: The minimum amount of CPU required. Only
+ used for `pod` strategy
+ type: string
+ requestMemory:
+ description: The minimum amount of memory required.
+ Only used for `pod` strategy
+ type: string
+ strategy:
+ description: the strategy to adopt
+ enum:
+ - routine
+ - pod
+ type: string
+ toolImage:
+ description: The container image to be used to run the
+ build.
+ type: string
+ type: object
dependencies:
description: the list of dependencies to use for this build
items:
@@ -572,6 +573,20 @@ spec:
type: string
type: array
type: object
+ custom:
+ description: UserTask is used to execute any generic custom
+ operation
+ properties:
+ command:
+ description: the command to execute
+ type: string
+ image:
+ description: the container image to use
+ type: string
+ name:
+ description: name of the task
+ type: string
+ type: object
kaniko:
description: a KanikoTask, for Kaniko strategy
properties:
@@ -678,15 +693,12 @@ spec:
type: object
type: array
timeout:
- description: Timeout defines the Build maximum execution duration.
- The Build deadline is set to the Build start time plus the Timeout
- duration. If the Build deadline is exceeded, the Build context is
- canceled, and its phase set to BuildPhaseFailed.
+ description: Timeout defines the Pipeline maximum execution duration.
+ The Pipeline deadline is set to the Pipeline start time plus the
+ Timeout duration. If the Pipeline deadline is exceeded, the Pipeline
+ context is canceled, and its phase set to BuildPhaseFailed.
format: duration
type: string
- toolImage:
- description: The container image to be used to run the build.
- type: string
type: object
status:
description: BuildStatus defines the observed state of Build
diff --git a/config/crd/bases/camel.apache.org_integrationplatforms.yaml b/config/crd/bases/camel.apache.org_integrationplatforms.yaml
index 09ca16fef..0248cb5e8 100644
--- a/config/crd/bases/camel.apache.org_integrationplatforms.yaml
+++ b/config/crd/bases/camel.apache.org_integrationplatforms.yaml
@@ -84,12 +84,14 @@ spec:
description: IntegrationPlatformSpec defines the desired state of IntegrationPlatform
properties:
build:
- description: specify how to build the Integration/IntegrationKits
+ description: 'Deprecated: no longer used in Camel K version 2, maintained
+ for backward compatibility with version 1. specify how to build
+ the Integration/IntegrationKits'
properties:
PublishStrategyOptions:
additionalProperties:
type: string
- description: Generic options that can used by each publish strategy
+ description: Generic options that can used by any publish strategy
type: object
baseImage:
description: a base image that can be used as base layer for all
@@ -112,6 +114,10 @@ spec:
description: The maximum amount of memory required. Only used
for `pod` strategy
type: string
+ operatorNamespace:
+ description: The namespace where to run the builder Pod (must
+ be the same of the operator in charge of this Build reconciliation).
+ type: string
requestCPU:
description: The minimum amount of CPU required. Only used
for `pod` strategy
@@ -126,6 +132,9 @@ spec:
- routine
- pod
type: string
+ toolImage:
+ description: The container image to be used to run the build.
+ type: string
type: object
maven:
description: Maven configuration used to build the Camel/Camel-Quarkus
@@ -279,8 +288,8 @@ spec:
type: object
type: object
maxRunningBuilds:
- description: the maximum amount of parallel running builds started
- by this operator instance
+ description: the maximum amount of parallel running pipelines
+ started by this operator instance
format: int32
type: integer
publishStrategy:
@@ -317,7 +326,8 @@ spec:
description: the Camel K Runtime dependency version
type: string
timeout:
- description: how much time to wait before time out the build process
+ description: how much time to wait before time out the pipeline
+ process
type: string
type: object
cluster:
@@ -364,6 +374,251 @@ spec:
type: object
type: array
type: object
+ pipeline:
+ description: specify how to build the Integration/IntegrationKits
+ properties:
+ PublishStrategyOptions:
+ additionalProperties:
+ type: string
+ description: Generic options that can used by any publish strategy
+ type: object
+ baseImage:
+ description: a base image that can be used as base layer for all
+ images. It can be useful if you want to provide some custom
+ base image with further utility softwares
+ type: string
+ buildCatalogToolTimeout:
+ description: the timeout (in seconds) to use when creating the
+ build tools container image
+ type: string
+ buildConfiguration:
+ description: the configuration required to build an Integration
+ container image
+ properties:
+ limitCPU:
+ description: The maximum amount of CPU required. Only used
+ for `pod` strategy
+ type: string
+ limitMemory:
+ description: The maximum amount of memory required. Only used
+ for `pod` strategy
+ type: string
+ operatorNamespace:
+ description: The namespace where to run the builder Pod (must
+ be the same of the operator in charge of this Build reconciliation).
+ type: string
+ requestCPU:
+ description: The minimum amount of CPU required. Only used
+ for `pod` strategy
+ type: string
+ requestMemory:
+ description: The minimum amount of memory required. Only used
+ for `pod` strategy
+ type: string
+ strategy:
+ description: the strategy to adopt
+ enum:
+ - routine
+ - pod
+ type: string
+ toolImage:
+ description: The container image to be used to run the build.
+ type: string
+ type: object
+ maven:
+ description: Maven configuration used to build the Camel/Camel-Quarkus
+ applications
+ properties:
+ caSecrets:
+ description: The Secrets name and key, containing the CA certificate(s)
+ used to connect to remote Maven repositories. It can contain
+ X.509 certificates, and PKCS#7 formatted certificate chains.
+ A JKS formatted keystore is automatically created to store
+ the CA certificate(s), and configured to be used as a trusted
+ certificate(s) by the Maven commands. Note that the root
+ CA certificates are also imported into the created keystore.
+ items:
+ description: SecretKeySelector selects a key of a Secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind, uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key must
+ be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: array
+ cliOptions:
+ description: The CLI options that are appended to the list
+ of arguments for Maven commands, e.g., `-V,--no-transfer-progress,-Dstyle.color=never`.
+ See https://maven.apache.org/ref/3.8.4/maven-embedder/cli.html.
+ items:
+ type: string
+ type: array
+ extension:
+ description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html.
+ items:
+ description: MavenArtifact defines a GAV (Group:Artifact:Version)
+ Maven artifact
+ properties:
+ artifactId:
+ description: Maven Artifact
+ type: string
+ groupId:
+ description: Maven Group
+ type: string
+ version:
+ description: Maven Version
+ type: string
+ required:
+ - artifactId
+ - groupId
+ type: object
+ type: array
+ localRepository:
+ description: The path of the local Maven repository.
+ type: string
+ properties:
+ additionalProperties:
+ type: string
+ description: The Maven properties.
+ type: object
+ settings:
+ description: A reference to the ConfigMap or Secret key that
+ contains the Maven settings.
+ properties:
+ configMapKeyRef:
+ description: Selects a key of a ConfigMap.
+ properties:
+ key:
+ description: The key to select.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the ConfigMap or its
+ key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ secretKeyRef:
+ description: Selects a key of a secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key
+ must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: object
+ settingsSecurity:
+ description: A reference to the ConfigMap or Secret key that
+ contains the security of the Maven settings.
+ properties:
+ configMapKeyRef:
+ description: Selects a key of a ConfigMap.
+ properties:
+ key:
+ description: The key to select.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the ConfigMap or its
+ key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ secretKeyRef:
+ description: Selects a key of a secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key
+ must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: object
+ type: object
+ maxRunningPipelines:
+ description: the maximum amount of parallel running pipelines
+ started by this operator instance
+ format: int32
+ type: integer
+ publishStrategy:
+ description: the strategy to adopt for publishing an Integration
+ container image
+ type: string
+ registry:
+ description: the image registry used to push/pull Integration
+ images
+ properties:
+ address:
+ description: the URI to access
+ type: string
+ ca:
+ description: the configmap which stores the Certificate Authority
+ type: string
+ insecure:
+ description: if the container registry is insecure (ie, http
+ only)
+ type: boolean
+ organization:
+ description: the registry organization
+ type: string
+ secret:
+ description: the secret where credentials are stored
+ type: string
+ type: object
+ runtimeProvider:
+ description: the runtime used. Likely Camel Quarkus (we used to
+ have main runtime which has been discontinued since version
+ 1.5)
+ type: string
+ runtimeVersion:
+ description: the Camel K Runtime dependency version
+ type: string
+ timeout:
+ description: how much time to wait before time out the pipeline
+ process
+ type: string
+ type: object
profile:
description: the profile you wish to use. It will apply certain traits
which are required by the specific profile chosen. It usually relates
@@ -1707,12 +1962,14 @@ spec:
description: IntegrationPlatformStatus defines the observed state of IntegrationPlatform
properties:
build:
- description: specify how to build the Integration/IntegrationKits
+ description: 'Deprecated: no longer used in Camel K version 2, maintained
+ for backward compatibility with version 1. specify how to build
+ the Integration/IntegrationKits'
properties:
PublishStrategyOptions:
additionalProperties:
type: string
- description: Generic options that can used by each publish strategy
+ description: Generic options that can used by any publish strategy
type: object
baseImage:
description: a base image that can be used as base layer for all
@@ -1735,6 +1992,10 @@ spec:
description: The maximum amount of memory required. Only used
for `pod` strategy
type: string
+ operatorNamespace:
+ description: The namespace where to run the builder Pod (must
+ be the same of the operator in charge of this Build reconciliation).
+ type: string
requestCPU:
description: The minimum amount of CPU required. Only used
for `pod` strategy
@@ -1749,6 +2010,9 @@ spec:
- routine
- pod
type: string
+ toolImage:
+ description: The container image to be used to run the build.
+ type: string
type: object
maven:
description: Maven configuration used to build the Camel/Camel-Quarkus
@@ -1902,8 +2166,8 @@ spec:
type: object
type: object
maxRunningBuilds:
- description: the maximum amount of parallel running builds started
- by this operator instance
+ description: the maximum amount of parallel running pipelines
+ started by this operator instance
format: int32
type: integer
publishStrategy:
@@ -1940,7 +2204,8 @@ spec:
description: the Camel K Runtime dependency version
type: string
timeout:
- description: how much time to wait before time out the build process
+ description: how much time to wait before time out the pipeline
+ process
type: string
type: object
cluster:
@@ -2035,6 +2300,251 @@ spec:
phase:
description: defines in what phase the IntegrationPlatform is found
type: string
+ pipeline:
+ description: specify how to build the Integration/IntegrationKits
+ properties:
+ PublishStrategyOptions:
+ additionalProperties:
+ type: string
+ description: Generic options that can used by any publish strategy
+ type: object
+ baseImage:
+ description: a base image that can be used as base layer for all
+ images. It can be useful if you want to provide some custom
+ base image with further utility softwares
+ type: string
+ buildCatalogToolTimeout:
+ description: the timeout (in seconds) to use when creating the
+ build tools container image
+ type: string
+ buildConfiguration:
+ description: the configuration required to build an Integration
+ container image
+ properties:
+ limitCPU:
+ description: The maximum amount of CPU required. Only used
+ for `pod` strategy
+ type: string
+ limitMemory:
+ description: The maximum amount of memory required. Only used
+ for `pod` strategy
+ type: string
+ operatorNamespace:
+ description: The namespace where to run the builder Pod (must
+ be the same of the operator in charge of this Build reconciliation).
+ type: string
+ requestCPU:
+ description: The minimum amount of CPU required. Only used
+ for `pod` strategy
+ type: string
+ requestMemory:
+ description: The minimum amount of memory required. Only used
+ for `pod` strategy
+ type: string
+ strategy:
+ description: the strategy to adopt
+ enum:
+ - routine
+ - pod
+ type: string
+ toolImage:
+ description: The container image to be used to run the build.
+ type: string
+ type: object
+ maven:
+ description: Maven configuration used to build the Camel/Camel-Quarkus
+ applications
+ properties:
+ caSecrets:
+ description: The Secrets name and key, containing the CA certificate(s)
+ used to connect to remote Maven repositories. It can contain
+ X.509 certificates, and PKCS#7 formatted certificate chains.
+ A JKS formatted keystore is automatically created to store
+ the CA certificate(s), and configured to be used as a trusted
+ certificate(s) by the Maven commands. Note that the root
+ CA certificates are also imported into the created keystore.
+ items:
+ description: SecretKeySelector selects a key of a Secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind, uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key must
+ be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: array
+ cliOptions:
+ description: The CLI options that are appended to the list
+ of arguments for Maven commands, e.g., `-V,--no-transfer-progress,-Dstyle.color=never`.
+ See https://maven.apache.org/ref/3.8.4/maven-embedder/cli.html.
+ items:
+ type: string
+ type: array
+ extension:
+ description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html.
+ items:
+ description: MavenArtifact defines a GAV (Group:Artifact:Version)
+ Maven artifact
+ properties:
+ artifactId:
+ description: Maven Artifact
+ type: string
+ groupId:
+ description: Maven Group
+ type: string
+ version:
+ description: Maven Version
+ type: string
+ required:
+ - artifactId
+ - groupId
+ type: object
+ type: array
+ localRepository:
+ description: The path of the local Maven repository.
+ type: string
+ properties:
+ additionalProperties:
+ type: string
+ description: The Maven properties.
+ type: object
+ settings:
+ description: A reference to the ConfigMap or Secret key that
+ contains the Maven settings.
+ properties:
+ configMapKeyRef:
+ description: Selects a key of a ConfigMap.
+ properties:
+ key:
+ description: The key to select.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the ConfigMap or its
+ key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ secretKeyRef:
+ description: Selects a key of a secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key
+ must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: object
+ settingsSecurity:
+ description: A reference to the ConfigMap or Secret key that
+ contains the security of the Maven settings.
+ properties:
+ configMapKeyRef:
+ description: Selects a key of a ConfigMap.
+ properties:
+ key:
+ description: The key to select.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the ConfigMap or its
+ key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ secretKeyRef:
+ description: Selects a key of a secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key
+ must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: object
+ type: object
+ maxRunningPipelines:
+ description: the maximum amount of parallel running pipelines
+ started by this operator instance
+ format: int32
+ type: integer
+ publishStrategy:
+ description: the strategy to adopt for publishing an Integration
+ container image
+ type: string
+ registry:
+ description: the image registry used to push/pull Integration
+ images
+ properties:
+ address:
+ description: the URI to access
+ type: string
+ ca:
+ description: the configmap which stores the Certificate Authority
+ type: string
+ insecure:
+ description: if the container registry is insecure (ie, http
+ only)
+ type: boolean
+ organization:
+ description: the registry organization
+ type: string
+ secret:
+ description: the secret where credentials are stored
+ type: string
+ type: object
+ runtimeProvider:
+ description: the runtime used. Likely Camel Quarkus (we used to
+ have main runtime which has been discontinued since version
+ 1.5)
+ type: string
+ runtimeVersion:
+ description: the Camel K Runtime dependency version
+ type: string
+ timeout:
+ description: how much time to wait before time out the pipeline
+ process
+ type: string
+ type: object
profile:
description: the profile you wish to use. It will apply certain traits
which are required by the specific profile chosen. It usually relates
diff --git a/config/samples/bases/camel_v1_integrationplatform.yaml b/config/samples/bases/camel_v1_integrationplatform.yaml
index fe0440802..2f36ec07b 100644
--- a/config/samples/bases/camel_v1_integrationplatform.yaml
+++ b/config/samples/bases/camel_v1_integrationplatform.yaml
@@ -22,6 +22,6 @@ metadata:
labels:
app: "camel-k"
spec:
- build:
+ pipeline:
buildConfiguration:
strategy: pod
diff --git a/docs/modules/ROOT/pages/architecture/cr/integration-platform.adoc b/docs/modules/ROOT/pages/architecture/cr/integration-platform.adoc
index d6052e4c5..54a8c0337 100644
--- a/docs/modules/ROOT/pages/architecture/cr/integration-platform.adoc
+++ b/docs/modules/ROOT/pages/architecture/cr/integration-platform.adoc
@@ -13,7 +13,7 @@ type IntegrationPlatform struct {
type IntegrationPlatformSpec struct {
Cluster IntegrationPlatformCluster // <3>
Profile TraitProfile // <4>
- Build IntegrationPlatformBuildSpec // <5>
+ Pipeline IntegrationPlatformPipelineSpec // <5>
Traits map[string]TraitSpec // <6>
Configuration []ConfigurationSpec // <6>
Kamelet []IntegrationPlatformKameletSpec // <7>
@@ -23,7 +23,7 @@ type IntegrationPlatformSpec struct {
<2> The status of the object at current time
<3> The type of the Kubernetes Cluster (Kubernetes or OpenShift)
<4> Configures the traits that have to be applied by default (Kubernetes, OpenShift, Knative)
-<5> Configuration options of the image build process such as the type of the builder (buildah, kanico, spectrum), the container registry and the maven repositories that have to be configured in order retrieve the artifacts needed by the integrations.
+<5> Configuration options of the image build process such as the type of the builder, the container registry and the maven repositories that have to be configured in order retrieve the artifacts needed by the integrations.
<6> The traits and configuration options (properties, secrets, configmaps) that have to be propagated to each integration.
<7> Locations to look up Kamelet definitions
diff --git a/docs/modules/ROOT/pages/installation/advanced/maven.adoc b/docs/modules/ROOT/pages/installation/advanced/maven.adoc
index 54af3674a..564e4bd64 100644
--- a/docs/modules/ROOT/pages/installation/advanced/maven.adoc
+++ b/docs/modules/ROOT/pages/installation/advanced/maven.adoc
@@ -12,7 +12,7 @@ The `kubectl` CLI provides convenient commands, to create a ConfigMap or a Secre
$ kubectl create configmap maven-settings --from-file=settings.xml
----
-The created ConfigMap or Secret can then be referenced in the IntegrationPlatform resource, from the `spec.build.maven.settings` field, e.g.:
+The created ConfigMap or Secret can then be referenced in the IntegrationPlatform resource, from the `spec.pipeline.maven.settings` field, e.g.:
[source,yaml]
----
@@ -21,7 +21,7 @@ kind: IntegrationPlatform
metadata:
name: camel-k
spec:
- build:
+ pipeline:
maven:
settings:
configMapKeyRef:
@@ -173,7 +173,7 @@ The Secret can contain X.509 certificates, and PKCS#7 formatted certificate chai
A JKS formatted keystore is automatically created to store the CA certificate(s), and configured to be used as a trusted certificate(s) by the Maven commands.
The root CA certificates are also imported into the created keystore.
-The created Secret can then be referenced in the IntegrationPlatform resource, from the `spec.build.maven.caSecret` field, e.g.:
+The created Secret can then be referenced in the IntegrationPlatform resource, from the `spec.pipeline.maven.caSecret` field, e.g.:
[source,yaml]
----
@@ -182,7 +182,7 @@ kind: IntegrationPlatform
metadata:
name: camel-k
spec:
- build:
+ pipeline:
maven:
caSecret:
key: tls.crt
@@ -206,7 +206,7 @@ The Maven https://maven.apache.org/guides/mini/guide-using-extensions.html[exten
$ kamel install --maven-extension fi.yle.tools:aws-maven:1.4.2
----
-The IntegrationPlatform resource stores extensions in the `spec.build.maven.extension` field, e.g:
+The IntegrationPlatform resource stores extensions in the `spec.pipeline.maven.extension` field, e.g:
[source,yaml]
----
@@ -216,7 +216,7 @@ metadata:
name: camel-k
spec:
build:
- maven:
+ pipeline:
extension:
- artifactId: aws-maven
groupId: fi.yle.tools
diff --git a/docs/modules/ROOT/pages/installation/advanced/multi-architecture.adoc b/docs/modules/ROOT/pages/installation/advanced/multi-architecture.adoc
index 45c0c2e4b..91b6fbb7c 100644
--- a/docs/modules/ROOT/pages/installation/advanced/multi-architecture.adoc
+++ b/docs/modules/ROOT/pages/installation/advanced/multi-architecture.adoc
@@ -59,11 +59,11 @@ If you want change the default architecture of buildah build strategy, you must
kubectl edit ip
----
-This command will open the editor with the yaml of `IntegrationPlatform`, to change the architecture you can fill inside `spec.build.PublishStrategyOptions` as below
+This command will open the editor with the yaml of `IntegrationPlatform`, to change the architecture you can fill inside `spec.pipeline.PublishStrategyOptions` as below
[source,yaml]
----
spec:
- build:
+ pipeline:
PublishStrategyOptions:
BuildahPlatform: linux/arm/v8
----
@@ -73,7 +73,7 @@ After few seconds the yaml will be updated and that field is imported inside sta
[source,yaml]
----
status:
- build:
+ pipeline:
PublishStrategyOptions:
BuildahPlatform: linux/arm/v8
----
diff --git a/docs/modules/ROOT/pages/installation/registry/registry.adoc b/docs/modules/ROOT/pages/installation/registry/registry.adoc
index ace777087..0f966bd96 100644
--- a/docs/modules/ROOT/pages/installation/registry/registry.adoc
+++ b/docs/modules/ROOT/pages/installation/registry/registry.adoc
@@ -20,7 +20,7 @@ Registry configuration can be set upon installation using command:
$ kamel install --registry registry-host.io --organization your-user-id-or-org --registry-secret the-push-kubernetes-secret-name
----
-Alternatively, the same settings can be set in the `.spec.build.registry` section of the `IntegrationPlatform` resource.
+Alternatively, the same settings can be set in the `.spec.pipeline.registry` section of the `IntegrationPlatform` resource.
[source,yaml]
----
@@ -31,7 +31,7 @@ metadata:
app: camel-k
name: camel-k
spec:
- build:
+ pipeline:
registry:
address: registry-host.io
organization: your-user-id-or-org
diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
index 4c8e52315..10af8c2f6 100644
--- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
+++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
@@ -31,7 +31,7 @@ string
Refer to the Kubernetes API documentation for the fields of the `metadata` field.
|`spec` +
-*xref:#_camel_apache_org_v1_BuildSpec[BuildSpec]*
+*xref:#_camel_apache_org_v1_PipelineSpec[PipelineSpec]*
|
@@ -388,6 +388,7 @@ a checksum (SHA1) of the content
* <<#_camel_apache_org_v1_KanikoTask, KanikoTask>>
* <<#_camel_apache_org_v1_S2iTask, S2iTask>>
* <<#_camel_apache_org_v1_SpectrumTask, SpectrumTask>>
+* <<#_camel_apache_org_v1_UserTask, UserTask>>
BaseTask is a base for the struct hierarchy
@@ -500,8 +501,9 @@ BuildConditionType --
*Appears on:*
-* <<#_camel_apache_org_v1_BuildSpec, BuildSpec>>
+* <<#_camel_apache_org_v1_BuilderTask, BuilderTask>>
* <<#_camel_apache_org_v1_IntegrationPlatformBuildSpec, IntegrationPlatformBuildSpec>>
+* <<#_camel_apache_org_v1_IntegrationPlatformPipelineSpec, IntegrationPlatformPipelineSpec>>
BuildConfiguration represent the configuration required to build the runtime
@@ -510,6 +512,20 @@ BuildConfiguration represent the configuration required to build the runtime
|Field
|Description
+|`toolImage` +
+string
+|
+
+
+The container image to be used to run the build.
+
+|`operatorNamespace` +
+string
+|
+
+
+The namespace where to run the builder Pod (must be the same of the operator in charge of this Build reconciliation).
+
|`strategy` +
*xref:#_camel_apache_org_v1_BuildStrategy[BuildStrategy]*
|
@@ -558,68 +574,6 @@ The maximum amount of memory required. Only used for `pod` strategy
BuildPhase --
-[#_camel_apache_org_v1_BuildSpec]
-=== BuildSpec
-
-*Appears on:*
-
-* <<#_camel_apache_org_v1_Build, Build>>
-
-BuildSpec defines the Build operation to be executed
-
-[cols="2,2a",options="header"]
-|===
-|Field
-|Description
-
-|`tasks` +
-*xref:#_camel_apache_org_v1_Task[[\]Task]*
-|
-
-
-The sequence of Build tasks to be performed as part of the Build execution.
-
-|`configuration` +
-*xref:#_camel_apache_org_v1_BuildConfiguration[BuildConfiguration]*
-|
-
-
-The configuration that should be used to perform the Build.
-
-|`toolImage` +
-string
-|
-
-
-The container image to be used to run the build.
-
-|`operatorNamespace` +
-string
-|
-
-
-The namespace where to run the builder Pod (must be the same of the operator in charge of this Build reconciliation).
-
-|`timeout` +
-*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#duration-v1-meta[Kubernetes meta/v1.Duration]*
-|
-
-
-Timeout defines the Build maximum execution duration.
-The Build deadline is set to the Build start time plus the Timeout duration.
-If the Build deadline is exceeded, the Build context is canceled,
-and its phase set to BuildPhaseFailed.
-
-|`maxRunningBuilds` +
-int32
-|
-
-
-the maximum amount of parallel running builds started by this operator instance
-
-
-|===
-
[#_camel_apache_org_v1_BuildStatus]
=== BuildStatus
@@ -801,6 +755,13 @@ BuilderTask is the generic task in charge of building the application image
+|`configuration` +
+*xref:#_camel_apache_org_v1_BuildConfiguration[BuildConfiguration]*
+|
+
+
+The configuration that should be used to perform the Build.
+
|`baseImage` +
string
|
@@ -2439,6 +2400,7 @@ IntegrationPhase --
*Appears on:*
* <<#_camel_apache_org_v1_IntegrationPlatformBuildSpec, IntegrationPlatformBuildSpec>>
+* <<#_camel_apache_org_v1_IntegrationPlatformPipelineSpec, IntegrationPlatformPipelineSpec>>
IntegrationPlatformBuildPublishStrategy defines the strategy used to package and publish an Integration base image
@@ -2450,7 +2412,7 @@ IntegrationPlatformBuildPublishStrategy defines the strategy used to package and
* <<#_camel_apache_org_v1_IntegrationPlatformSpec, IntegrationPlatformSpec>>
-IntegrationPlatformBuildSpec contains platform related build information.
+IntegrationPlatformBuildSpec contains platform related pipeline information.
This configuration can be used to tune the behavior of the Integration/IntegrationKit image builds.
You can define the build strategy, the image registry to use and the Maven configuration to adopt.
@@ -2514,7 +2476,7 @@ the timeout (in seconds) to use when creating the build tools container image
|
-how much time to wait before time out the build process
+how much time to wait before time out the pipeline process
|`maven` +
*xref:#_camel_apache_org_v1_MavenSpec[MavenSpec]*
@@ -2528,14 +2490,14 @@ map[string]string
|
-Generic options that can used by each publish strategy
+Generic options that can used by any publish strategy
|`maxRunningBuilds` +
int32
|
-the maximum amount of parallel running builds started by this operator instance
+the maximum amount of parallel running pipelines started by this operator instance
|===
@@ -2677,6 +2639,103 @@ remote repository used to retrieve Kamelet catalog
IntegrationPlatformPhase is the phase of an IntegrationPlatform
+[#_camel_apache_org_v1_IntegrationPlatformPipelineSpec]
+=== IntegrationPlatformPipelineSpec
+
+*Appears on:*
+
+* <<#_camel_apache_org_v1_IntegrationPlatformSpec, IntegrationPlatformSpec>>
+
+IntegrationPlatformPipelineSpec contains platform related pipeline information.
+This configuration can be used to tune the behavior of the Integration/IntegrationKit image builds.
+You can define the build strategy, the image registry to use and the Maven configuration to adopt.
+
+[cols="2,2a",options="header"]
+|===
+|Field
+|Description
+
+|`buildConfiguration` +
+*xref:#_camel_apache_org_v1_BuildConfiguration[BuildConfiguration]*
+|
+
+
+the configuration required to build an Integration container image
+
+|`publishStrategy` +
+*xref:#_camel_apache_org_v1_IntegrationPlatformBuildPublishStrategy[IntegrationPlatformBuildPublishStrategy]*
+|
+
+
+the strategy to adopt for publishing an Integration container image
+
+|`runtimeVersion` +
+string
+|
+
+
+the Camel K Runtime dependency version
+
+|`runtimeProvider` +
+*xref:#_camel_apache_org_v1_RuntimeProvider[RuntimeProvider]*
+|
+
+
+the runtime used. Likely Camel Quarkus (we used to have main runtime which has been discontinued since version 1.5)
+
+|`baseImage` +
+string
+|
+
+
+a base image that can be used as base layer for all images.
+It can be useful if you want to provide some custom base image with further utility softwares
+
+|`registry` +
+*xref:#_camel_apache_org_v1_RegistrySpec[RegistrySpec]*
+|
+
+
+the image registry used to push/pull Integration images
+
+|`buildCatalogToolTimeout` +
+*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#duration-v1-meta[Kubernetes meta/v1.Duration]*
+|
+
+
+the timeout (in seconds) to use when creating the build tools container image
+
+|`timeout` +
+*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#duration-v1-meta[Kubernetes meta/v1.Duration]*
+|
+
+
+how much time to wait before time out the pipeline process
+
+|`maven` +
+*xref:#_camel_apache_org_v1_MavenSpec[MavenSpec]*
+|
+
+
+Maven configuration used to build the Camel/Camel-Quarkus applications
+
+|`PublishStrategyOptions` +
+map[string]string
+|
+
+
+Generic options that can used by any publish strategy
+
+|`maxRunningPipelines` +
+int32
+|
+
+
+the maximum amount of parallel running pipelines started by this operator instance
+
+
+|===
+
[#_camel_apache_org_v1_IntegrationPlatformSpec]
=== IntegrationPlatformSpec
@@ -2712,6 +2771,14 @@ It usually relates the Cluster with the optional definition of special profiles
|
+Deprecated: no longer used in Camel K version 2, maintained for backward compatibility with version 1.
+specify how to build the Integration/IntegrationKits
+
+|`pipeline` +
+*xref:#_camel_apache_org_v1_IntegrationPlatformPipelineSpec[IntegrationPlatformPipelineSpec]*
+|
+
+
specify how to build the Integration/IntegrationKits
|`traits` +
@@ -3768,6 +3835,7 @@ Servers (auth)
*Appears on:*
* <<#_camel_apache_org_v1_IntegrationPlatformBuildSpec, IntegrationPlatformBuildSpec>>
+* <<#_camel_apache_org_v1_IntegrationPlatformPipelineSpec, IntegrationPlatformPipelineSpec>>
* <<#_camel_apache_org_v1_MavenBuildSpec, MavenBuildSpec>>
MavenSpec --
@@ -4041,6 +4109,40 @@ string
Selector allows to identify pods belonging to the pipe
+|===
+
+[#_camel_apache_org_v1_PipelineSpec]
+=== PipelineSpec
+
+*Appears on:*
+
+* <<#_camel_apache_org_v1_Build, Build>>
+
+PipelineSpec defines the Build operation to be executed
+
+[cols="2,2a",options="header"]
+|===
+|Field
+|Description
+
+|`tasks` +
+*xref:#_camel_apache_org_v1_Task[[\]Task]*
+|
+
+
+The sequence of Build tasks to be performed as part of the Build execution.
+
+|`timeout` +
+*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#duration-v1-meta[Kubernetes meta/v1.Duration]*
+|
+
+
+Timeout defines the Pipeline maximum execution duration.
+The Pipeline deadline is set to the Pipeline start time plus the Timeout duration.
+If the Pipeline deadline is exceeded, the Pipeline context is canceled,
+and its phase set to BuildPhaseFailed.
+
+
|===
[#_camel_apache_org_v1_PluginProperties]
@@ -4291,6 +4393,7 @@ be used to delay JSON decoding or precompute a JSON encoding.
*Appears on:*
* <<#_camel_apache_org_v1_IntegrationPlatformBuildSpec, IntegrationPlatformBuildSpec>>
+* <<#_camel_apache_org_v1_IntegrationPlatformPipelineSpec, IntegrationPlatformPipelineSpec>>
* <<#_camel_apache_org_v1_PublishTask, PublishTask>>
RegistrySpec provides the configuration for the container registry
@@ -4444,6 +4547,7 @@ ResourceCondition is a common type for all conditions
* <<#_camel_apache_org_v1_IntegrationKitStatus, IntegrationKitStatus>>
* <<#_camel_apache_org_v1_IntegrationPlatformBuildSpec, IntegrationPlatformBuildSpec>>
+* <<#_camel_apache_org_v1_IntegrationPlatformPipelineSpec, IntegrationPlatformPipelineSpec>>
* <<#_camel_apache_org_v1_IntegrationStatus, IntegrationStatus>>
* <<#_camel_apache_org_v1_RuntimeSpec, RuntimeSpec>>
@@ -4738,7 +4842,7 @@ string
*Appears on:*
-* <<#_camel_apache_org_v1_BuildSpec, BuildSpec>>
+* <<#_camel_apache_org_v1_PipelineSpec, PipelineSpec>>
Task represents the abstract task. Only one of the task should be configured to represent the specific task chosen.
@@ -4752,7 +4856,7 @@ Task represents the abstract task. Only one of the task should be configured to
|
-a BuilderTask (base task)
+a BuilderTask, used to generate and package the project
|`buildah` +
*xref:#_camel_apache_org_v1_BuildahTask[BuildahTask]*
@@ -4782,6 +4886,13 @@ a SpectrumTask, for Spectrum strategy
a S2iTask, for S2I strategy
+|`custom` +
+*xref:#_camel_apache_org_v1_UserTask[UserTask]*
+|
+
+
+
+
|===
@@ -5176,6 +5287,44 @@ Deprecated: for backward compatibility.
TypeSlot represent a kind of data (ie, input, output, ...)
+[#_camel_apache_org_v1_UserTask]
+=== UserTask
+
+*Appears on:*
+
+* <<#_camel_apache_org_v1_Task, Task>>
+
+UserTask is used to execute any generic custom operation
+
+[cols="2,2a",options="header"]
+|===
+|Field
+|Description
+
+|`BaseTask` +
+*xref:#_camel_apache_org_v1_BaseTask[BaseTask]*
+|(Members of `BaseTask` are embedded into this type.)
+
+
+
+
+|`image` +
+string
+|
+
+
+the container image to use
+
+|`command` +
+string
+|
+
+
+the command to execute
+
+
+|===
+
[#_camel_apache_org_v1_ValueSource]
=== ValueSource
diff --git a/e2e/builder/build_test.go b/e2e/builder/build_test.go
index ae4835f13..3d083d4ba 100644
--- a/e2e/builder/build_test.go
+++ b/e2e/builder/build_test.go
@@ -46,7 +46,7 @@ func TestKitMaxBuildLimit(t *testing.T) {
pl := Platform(ns)()
// set maximum number of running builds
- pl.Spec.Build.MaxRunningBuilds = 2
+ pl.Spec.Pipeline.MaxRunningPipelines = 2
if err := TestClient().Update(TestContext, pl); err != nil {
t.Error(err)
t.FailNow()
@@ -60,7 +60,7 @@ func TestKitMaxBuildLimit(t *testing.T) {
WithNewTestNamespace(t, func(ns2 string) {
pl1 := v1.NewIntegrationPlatform(ns1, fmt.Sprintf("camel-k-%s", ns))
pl.Spec.DeepCopyInto(&pl1.Spec)
- pl1.Spec.Build.Maven.Settings = v1.ValueSource{}
+ pl1.Spec.Pipeline.Maven.Settings = v1.ValueSource{}
pl1.SetOperatorID(fmt.Sprintf("camel-k-%s", ns))
if err := TestClient().Create(TestContext, &pl1); err != nil {
t.Error(err)
@@ -71,7 +71,7 @@ func TestKitMaxBuildLimit(t *testing.T) {
pl2 := v1.NewIntegrationPlatform(ns2, fmt.Sprintf("camel-k-%s", ns))
pl.Spec.DeepCopyInto(&pl2.Spec)
- pl2.Spec.Build.Maven.Settings = v1.ValueSource{}
+ pl2.Spec.Pipeline.Maven.Settings = v1.ValueSource{}
pl2.SetOperatorID(fmt.Sprintf("camel-k-%s", ns))
if err := TestClient().Create(TestContext, &pl2); err != nil {
t.Error(err)
diff --git a/e2e/commonwithcustominstall/builder_test.go b/e2e/commonwithcustominstall/builder_test.go
index 05c6d188d..759c33194 100644
--- a/e2e/commonwithcustominstall/builder_test.go
+++ b/e2e/commonwithcustominstall/builder_test.go
@@ -66,7 +66,7 @@ func TestBuilderTimeout(t *testing.T) {
pl := Platform(ns)()
// set a short timeout to simulate the build timeout
- pl.Spec.Build.Timeout = &metav1.Duration{
+ pl.Spec.Pipeline.Timeout = &metav1.Duration{
Duration: 10 * time.Second,
}
TestClient().Update(TestContext, pl)
diff --git a/e2e/commonwithcustominstall/catalog_builder_test.go b/e2e/commonwithcustominstall/catalog_builder_test.go
index 9184c1ff7..81ec68121 100644
--- a/e2e/commonwithcustominstall/catalog_builder_test.go
+++ b/e2e/commonwithcustominstall/catalog_builder_test.go
@@ -156,7 +156,7 @@ func TestCamelCatalogBuilder(t *testing.T) {
pl := Platform(ns)()
// set a very short timeout to simulate the timeout
- pl.Spec.Build.BuildCatalogToolTimeout = &metav1.Duration{
+ pl.Spec.Pipeline.BuildCatalogToolTimeout = &metav1.Duration{
Duration: 1 * time.Second,
}
TestClient().Update(TestContext, pl)
diff --git a/e2e/commonwithcustominstall/local_platform_test.go b/e2e/commonwithcustominstall/local_platform_test.go
index 500b6bd1f..78d8e79d9 100644
--- a/e2e/commonwithcustominstall/local_platform_test.go
+++ b/e2e/commonwithcustominstall/local_platform_test.go
@@ -40,23 +40,23 @@ func TestLocalPlatform(t *testing.T) {
Eventually(PlatformPhase(ns), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
pl := Platform(ns)()
- pl.Spec.Build.Maven.Properties = make(map[string]string)
- pl.Spec.Build.Maven.Properties["build-global-prop1"] = "build-global-value1"
+ pl.Spec.Pipeline.Maven.Properties = make(map[string]string)
+ pl.Spec.Pipeline.Maven.Properties["build-global-prop1"] = "build-global-value1"
// set maximum number of running builds
- pl.Spec.Build.MaxRunningBuilds = 1
+ pl.Spec.Pipeline.MaxRunningPipelines = 1
if err := TestClient().Update(TestContext, pl); err != nil {
t.Error(err)
t.FailNow()
}
Eventually(PlatformHas(ns, func(pl *v1.IntegrationPlatform) bool {
- return pl.Status.Build.MaxRunningBuilds == 1
+ return pl.Status.Pipeline.MaxRunningPipelines == 1
}), TestTimeoutMedium).Should(BeTrue())
WithNewTestNamespace(t, func(ns1 string) {
localPlatform := v1.NewIntegrationPlatform(ns1, operatorID)
- localPlatform.Spec.Build.Maven.Properties = make(map[string]string)
- localPlatform.Spec.Build.Maven.Properties["build-local-prop1"] = "build-local-value1"
+ localPlatform.Spec.Pipeline.Maven.Properties = make(map[string]string)
+ localPlatform.Spec.Pipeline.Maven.Properties["build-local-prop1"] = "build-local-value1"
localPlatform.SetOperatorID(operatorID)
localPlatform.Spec.Traits.Container = &traitv1.ContainerTrait{
@@ -73,18 +73,18 @@ func TestLocalPlatform(t *testing.T) {
}), TestTimeoutShort).Should(BeTrue())
Eventually(PlatformHas(ns1, func(pl *v1.IntegrationPlatform) bool {
- return pl.Status.Build.MaxRunningBuilds == 1
+ return pl.Status.Pipeline.MaxRunningPipelines == 1
}), TestTimeoutShort).Should(BeTrue())
local := Platform(ns1)()
- Expect(local.Status.Build.PublishStrategy).To(Equal(pl.Status.Build.PublishStrategy))
- Expect(local.Status.Build.BuildConfiguration.Strategy).To(Equal(pl.Status.Build.BuildConfiguration.Strategy))
- Expect(local.Status.Build.Maven.LocalRepository).To(Equal(pl.Status.Build.Maven.LocalRepository))
- Expect(local.Status.Build.Maven.CLIOptions).To(ContainElements(pl.Status.Build.Maven.CLIOptions))
- Expect(local.Status.Build.Maven.Extension).To(BeEmpty())
- Expect(local.Status.Build.Maven.Properties).To(HaveLen(2))
- Expect(local.Status.Build.Maven.Properties["build-global-prop1"]).To(Equal("build-global-value1"))
- Expect(local.Status.Build.Maven.Properties["build-local-prop1"]).To(Equal("build-local-value1"))
+ Expect(local.Status.Pipeline.PublishStrategy).To(Equal(pl.Status.Pipeline.PublishStrategy))
+ Expect(local.Status.Pipeline.BuildConfiguration.Strategy).To(Equal(pl.Status.Pipeline.BuildConfiguration.Strategy))
+ Expect(local.Status.Pipeline.Maven.LocalRepository).To(Equal(pl.Status.Pipeline.Maven.LocalRepository))
+ Expect(local.Status.Pipeline.Maven.CLIOptions).To(ContainElements(pl.Status.Pipeline.Maven.CLIOptions))
+ Expect(local.Status.Pipeline.Maven.Extension).To(BeEmpty())
+ Expect(local.Status.Pipeline.Maven.Properties).To(HaveLen(2))
+ Expect(local.Status.Pipeline.Maven.Properties["build-global-prop1"]).To(Equal("build-global-value1"))
+ Expect(local.Status.Pipeline.Maven.Properties["build-local-prop1"]).To(Equal("build-local-value1"))
Expect(KamelRunWithID(operatorID, ns1, "--name", "local-integration", "files/yaml.yaml").Execute()).To(Succeed())
Eventually(IntegrationPod(ns1, "local-integration"), TestTimeoutMedium).Should(Not(BeNil()))
diff --git a/e2e/install/cli/install_test.go b/e2e/install/cli/install_test.go
index 40f52afc8..ae17af71b 100644
--- a/e2e/install/cli/install_test.go
+++ b/e2e/install/cli/install_test.go
@@ -150,7 +150,7 @@ func TestSkipRegistryInstallation(t *testing.T) {
Expect(KamelInstallWithID(operatorID, ns, "--skip-registry-setup").Execute()).To(Succeed())
Eventually(Platform(ns)).ShouldNot(BeNil())
Eventually(func() v1.RegistrySpec {
- return Platform(ns)().Spec.Build.Registry
+ return Platform(ns)().Spec.Pipeline.Registry
}, TestTimeoutMedium).Should(Equal(v1.RegistrySpec{}))
})
}
@@ -234,10 +234,10 @@ func TestInstallWithPublishStrategyOptions(t *testing.T) {
Eventually(OperatorPod(ns)).ShouldNot(BeNil())
Eventually(Platform(ns)).ShouldNot(BeNil())
Eventually(func() map[string]string {
- return Platform(ns)().Spec.Build.PublishStrategyOptions
+ return Platform(ns)().Spec.Pipeline.PublishStrategyOptions
}).Should(HaveKeyWithValue("KanikoExecutorImage", "foo"))
Eventually(func() map[string]string {
- return Platform(ns)().Spec.Build.PublishStrategyOptions
+ return Platform(ns)().Spec.Pipeline.PublishStrategyOptions
}).Should(HaveKeyWithValue("KanikoWarmerImage", "bar"))
})
}
diff --git a/e2e/native/native_binding_test.go b/e2e/native/native_binding_test.go
index 56f21f6ba..01c506c8c 100644
--- a/e2e/native/native_binding_test.go
+++ b/e2e/native/native_binding_test.go
@@ -43,7 +43,7 @@ func TestNativeBinding(t *testing.T) {
pl := Platform(ns)()
// set a longer timeout than default as for some reason the builder hit the timeout
- pl.Spec.Build.BuildCatalogToolTimeout = &metav1.Duration{
+ pl.Spec.Pipeline.BuildCatalogToolTimeout = &metav1.Duration{
Duration: 5 * time.Minute,
}
TestClient().Update(TestContext, pl)
diff --git a/e2e/native/native_with_sources_test.go b/e2e/native/native_with_sources_test.go
index cb3101c84..a92d3e6b8 100644
--- a/e2e/native/native_with_sources_test.go
+++ b/e2e/native/native_with_sources_test.go
@@ -45,7 +45,7 @@ func TestNativeHighMemoryIntegrations(t *testing.T) {
pl := Platform(ns)()
// set a longer timeout than default as for some reason the builder hit the timeout
- pl.Spec.Build.BuildCatalogToolTimeout = &metav1.Duration{
+ pl.Spec.Pipeline.BuildCatalogToolTimeout = &metav1.Duration{
Duration: 5 * time.Minute,
}
TestClient().Update(TestContext, pl)
diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go
index 860eb0b1b..6ebb7976b 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -1614,7 +1614,7 @@ func BuildConfig(ns, name string) func() v1.BuildConfiguration {
return func() v1.BuildConfiguration {
build := Build(ns, name)()
if build != nil {
- return build.Spec.Configuration
+ return *build.BuilderConfiguration()
}
return v1.BuildConfiguration{}
}
@@ -1882,7 +1882,7 @@ func PlatformBuildCatalogToolTimeout(ns string) func() *metav1.Duration {
if p == nil {
return &metav1.Duration{}
}
- return p.Status.Build.BuildCatalogToolTimeout
+ return p.Status.Pipeline.BuildCatalogToolTimeout
}
}
@@ -1892,7 +1892,7 @@ func PlatformTimeout(ns string) func() *metav1.Duration {
if p == nil {
return &metav1.Duration{}
}
- return p.Status.Build.Timeout
+ return p.Status.Pipeline.Timeout
}
}
diff --git a/helm/camel-k/crds/crd-build.yaml b/helm/camel-k/crds/crd-build.yaml
index 70e54e1dd..d24d8135b 100644
--- a/helm/camel-k/crds/crd-build.yaml
+++ b/helm/camel-k/crds/crd-build.yaml
@@ -77,44 +77,8 @@ spec:
metadata:
type: object
spec:
- description: BuildSpec defines the Build operation to be executed
+ description: PipelineSpec defines the Build operation to be executed
properties:
- configuration:
- description: The configuration that should be used to perform the
- Build.
- properties:
- limitCPU:
- description: The maximum amount of CPU required. Only used for
- `pod` strategy
- type: string
- limitMemory:
- description: The maximum amount of memory required. Only used
- for `pod` strategy
- type: string
- requestCPU:
- description: The minimum amount of CPU required. Only used for
- `pod` strategy
- type: string
- requestMemory:
- description: The minimum amount of memory required. Only used
- for `pod` strategy
- type: string
- strategy:
- description: the strategy to adopt
- enum:
- - routine
- - pod
- type: string
- type: object
- maxRunningBuilds:
- description: the maximum amount of parallel running builds started
- by this operator instance
- format: int32
- type: integer
- operatorNamespace:
- description: The namespace where to run the builder Pod (must be the
- same of the operator in charge of this Build reconciliation).
- type: string
tasks:
description: The sequence of Build tasks to be performed as part of
the Build execution.
@@ -169,7 +133,8 @@ spec:
type: boolean
type: object
builder:
- description: a BuilderTask (base task)
+ description: a BuilderTask, used to generate and package the
+ project
properties:
baseImage:
description: the base image layer
@@ -177,6 +142,42 @@ spec:
buildDir:
description: workspace directory to use
type: string
+ configuration:
+ description: The configuration that should be used to perform
+ the Build.
+ properties:
+ limitCPU:
+ description: The maximum amount of CPU required. Only
+ used for `pod` strategy
+ type: string
+ limitMemory:
+ description: The maximum amount of memory required.
+ Only used for `pod` strategy
+ type: string
+ operatorNamespace:
+ description: The namespace where to run the builder
+ Pod (must be the same of the operator in charge of
+ this Build reconciliation).
+ type: string
+ requestCPU:
+ description: The minimum amount of CPU required. Only
+ used for `pod` strategy
+ type: string
+ requestMemory:
+ description: The minimum amount of memory required.
+ Only used for `pod` strategy
+ type: string
+ strategy:
+ description: the strategy to adopt
+ enum:
+ - routine
+ - pod
+ type: string
+ toolImage:
+ description: The container image to be used to run the
+ build.
+ type: string
+ type: object
dependencies:
description: the list of dependencies to use for this build
items:
@@ -572,6 +573,20 @@ spec:
type: string
type: array
type: object
+ custom:
+ description: UserTask is used to execute any generic custom
+ operation
+ properties:
+ command:
+ description: the command to execute
+ type: string
+ image:
+ description: the container image to use
+ type: string
+ name:
+ description: name of the task
+ type: string
+ type: object
kaniko:
description: a KanikoTask, for Kaniko strategy
properties:
@@ -678,15 +693,12 @@ spec:
type: object
type: array
timeout:
- description: Timeout defines the Build maximum execution duration.
- The Build deadline is set to the Build start time plus the Timeout
- duration. If the Build deadline is exceeded, the Build context is
- canceled, and its phase set to BuildPhaseFailed.
+ description: Timeout defines the Pipeline maximum execution duration.
+ The Pipeline deadline is set to the Pipeline start time plus the
+ Timeout duration. If the Pipeline deadline is exceeded, the Pipeline
+ context is canceled, and its phase set to BuildPhaseFailed.
format: duration
type: string
- toolImage:
- description: The container image to be used to run the build.
- type: string
type: object
status:
description: BuildStatus defines the observed state of Build
diff --git a/helm/camel-k/crds/crd-integration-platform.yaml b/helm/camel-k/crds/crd-integration-platform.yaml
index 09ca16fef..0248cb5e8 100644
--- a/helm/camel-k/crds/crd-integration-platform.yaml
+++ b/helm/camel-k/crds/crd-integration-platform.yaml
@@ -84,12 +84,14 @@ spec:
description: IntegrationPlatformSpec defines the desired state of IntegrationPlatform
properties:
build:
- description: specify how to build the Integration/IntegrationKits
+ description: 'Deprecated: no longer used in Camel K version 2, maintained
+ for backward compatibility with version 1. specify how to build
+ the Integration/IntegrationKits'
properties:
PublishStrategyOptions:
additionalProperties:
type: string
- description: Generic options that can used by each publish strategy
+ description: Generic options that can used by any publish strategy
type: object
baseImage:
description: a base image that can be used as base layer for all
@@ -112,6 +114,10 @@ spec:
description: The maximum amount of memory required. Only used
for `pod` strategy
type: string
+ operatorNamespace:
+ description: The namespace where to run the builder Pod (must
+ be the same of the operator in charge of this Build reconciliation).
+ type: string
requestCPU:
description: The minimum amount of CPU required. Only used
for `pod` strategy
@@ -126,6 +132,9 @@ spec:
- routine
- pod
type: string
+ toolImage:
+ description: The container image to be used to run the build.
+ type: string
type: object
maven:
description: Maven configuration used to build the Camel/Camel-Quarkus
@@ -279,8 +288,8 @@ spec:
type: object
type: object
maxRunningBuilds:
- description: the maximum amount of parallel running builds started
- by this operator instance
+ description: the maximum amount of parallel running pipelines
+ started by this operator instance
format: int32
type: integer
publishStrategy:
@@ -317,7 +326,8 @@ spec:
description: the Camel K Runtime dependency version
type: string
timeout:
- description: how much time to wait before time out the build process
+ description: how much time to wait before time out the pipeline
+ process
type: string
type: object
cluster:
@@ -364,6 +374,251 @@ spec:
type: object
type: array
type: object
+ pipeline:
+ description: specify how to build the Integration/IntegrationKits
+ properties:
+ PublishStrategyOptions:
+ additionalProperties:
+ type: string
+ description: Generic options that can used by any publish strategy
+ type: object
+ baseImage:
+ description: a base image that can be used as base layer for all
+ images. It can be useful if you want to provide some custom
+ base image with further utility softwares
+ type: string
+ buildCatalogToolTimeout:
+ description: the timeout (in seconds) to use when creating the
+ build tools container image
+ type: string
+ buildConfiguration:
+ description: the configuration required to build an Integration
+ container image
+ properties:
+ limitCPU:
+ description: The maximum amount of CPU required. Only used
+ for `pod` strategy
+ type: string
+ limitMemory:
+ description: The maximum amount of memory required. Only used
+ for `pod` strategy
+ type: string
+ operatorNamespace:
+ description: The namespace where to run the builder Pod (must
+ be the same of the operator in charge of this Build reconciliation).
+ type: string
+ requestCPU:
+ description: The minimum amount of CPU required. Only used
+ for `pod` strategy
+ type: string
+ requestMemory:
+ description: The minimum amount of memory required. Only used
+ for `pod` strategy
+ type: string
+ strategy:
+ description: the strategy to adopt
+ enum:
+ - routine
+ - pod
+ type: string
+ toolImage:
+ description: The container image to be used to run the build.
+ type: string
+ type: object
+ maven:
+ description: Maven configuration used to build the Camel/Camel-Quarkus
+ applications
+ properties:
+ caSecrets:
+ description: The Secrets name and key, containing the CA certificate(s)
+ used to connect to remote Maven repositories. It can contain
+ X.509 certificates, and PKCS#7 formatted certificate chains.
+ A JKS formatted keystore is automatically created to store
+ the CA certificate(s), and configured to be used as a trusted
+ certificate(s) by the Maven commands. Note that the root
+ CA certificates are also imported into the created keystore.
+ items:
+ description: SecretKeySelector selects a key of a Secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind, uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key must
+ be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: array
+ cliOptions:
+ description: The CLI options that are appended to the list
+ of arguments for Maven commands, e.g., `-V,--no-transfer-progress,-Dstyle.color=never`.
+ See https://maven.apache.org/ref/3.8.4/maven-embedder/cli.html.
+ items:
+ type: string
+ type: array
+ extension:
+ description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html.
+ items:
+ description: MavenArtifact defines a GAV (Group:Artifact:Version)
+ Maven artifact
+ properties:
+ artifactId:
+ description: Maven Artifact
+ type: string
+ groupId:
+ description: Maven Group
+ type: string
+ version:
+ description: Maven Version
+ type: string
+ required:
+ - artifactId
+ - groupId
+ type: object
+ type: array
+ localRepository:
+ description: The path of the local Maven repository.
+ type: string
+ properties:
+ additionalProperties:
+ type: string
+ description: The Maven properties.
+ type: object
+ settings:
+ description: A reference to the ConfigMap or Secret key that
+ contains the Maven settings.
+ properties:
+ configMapKeyRef:
+ description: Selects a key of a ConfigMap.
+ properties:
+ key:
+ description: The key to select.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the ConfigMap or its
+ key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ secretKeyRef:
+ description: Selects a key of a secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key
+ must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: object
+ settingsSecurity:
+ description: A reference to the ConfigMap or Secret key that
+ contains the security of the Maven settings.
+ properties:
+ configMapKeyRef:
+ description: Selects a key of a ConfigMap.
+ properties:
+ key:
+ description: The key to select.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the ConfigMap or its
+ key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ secretKeyRef:
+ description: Selects a key of a secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key
+ must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: object
+ type: object
+ maxRunningPipelines:
+ description: the maximum amount of parallel running pipelines
+ started by this operator instance
+ format: int32
+ type: integer
+ publishStrategy:
+ description: the strategy to adopt for publishing an Integration
+ container image
+ type: string
+ registry:
+ description: the image registry used to push/pull Integration
+ images
+ properties:
+ address:
+ description: the URI to access
+ type: string
+ ca:
+ description: the configmap which stores the Certificate Authority
+ type: string
+ insecure:
+ description: if the container registry is insecure (ie, http
+ only)
+ type: boolean
+ organization:
+ description: the registry organization
+ type: string
+ secret:
+ description: the secret where credentials are stored
+ type: string
+ type: object
+ runtimeProvider:
+ description: the runtime used. Likely Camel Quarkus (we used to
+ have main runtime which has been discontinued since version
+ 1.5)
+ type: string
+ runtimeVersion:
+ description: the Camel K Runtime dependency version
+ type: string
+ timeout:
+ description: how much time to wait before time out the pipeline
+ process
+ type: string
+ type: object
profile:
description: the profile you wish to use. It will apply certain traits
which are required by the specific profile chosen. It usually relates
@@ -1707,12 +1962,14 @@ spec:
description: IntegrationPlatformStatus defines the observed state of IntegrationPlatform
properties:
build:
- description: specify how to build the Integration/IntegrationKits
+ description: 'Deprecated: no longer used in Camel K version 2, maintained
+ for backward compatibility with version 1. specify how to build
+ the Integration/IntegrationKits'
properties:
PublishStrategyOptions:
additionalProperties:
type: string
- description: Generic options that can used by each publish strategy
+ description: Generic options that can used by any publish strategy
type: object
baseImage:
description: a base image that can be used as base layer for all
@@ -1735,6 +1992,10 @@ spec:
description: The maximum amount of memory required. Only used
for `pod` strategy
type: string
+ operatorNamespace:
+ description: The namespace where to run the builder Pod (must
+ be the same of the operator in charge of this Build reconciliation).
+ type: string
requestCPU:
description: The minimum amount of CPU required. Only used
for `pod` strategy
@@ -1749,6 +2010,9 @@ spec:
- routine
- pod
type: string
+ toolImage:
+ description: The container image to be used to run the build.
+ type: string
type: object
maven:
description: Maven configuration used to build the Camel/Camel-Quarkus
@@ -1902,8 +2166,8 @@ spec:
type: object
type: object
maxRunningBuilds:
- description: the maximum amount of parallel running builds started
- by this operator instance
+ description: the maximum amount of parallel running pipelines
+ started by this operator instance
format: int32
type: integer
publishStrategy:
@@ -1940,7 +2204,8 @@ spec:
description: the Camel K Runtime dependency version
type: string
timeout:
- description: how much time to wait before time out the build process
+ description: how much time to wait before time out the pipeline
+ process
type: string
type: object
cluster:
@@ -2035,6 +2300,251 @@ spec:
phase:
description: defines in what phase the IntegrationPlatform is found
type: string
+ pipeline:
+ description: specify how to build the Integration/IntegrationKits
+ properties:
+ PublishStrategyOptions:
+ additionalProperties:
+ type: string
+ description: Generic options that can used by any publish strategy
+ type: object
+ baseImage:
+ description: a base image that can be used as base layer for all
+ images. It can be useful if you want to provide some custom
+ base image with further utility softwares
+ type: string
+ buildCatalogToolTimeout:
+ description: the timeout (in seconds) to use when creating the
+ build tools container image
+ type: string
+ buildConfiguration:
+ description: the configuration required to build an Integration
+ container image
+ properties:
+ limitCPU:
+ description: The maximum amount of CPU required. Only used
+ for `pod` strategy
+ type: string
+ limitMemory:
+ description: The maximum amount of memory required. Only used
+ for `pod` strategy
+ type: string
+ operatorNamespace:
+ description: The namespace where to run the builder Pod (must
+ be the same of the operator in charge of this Build reconciliation).
+ type: string
+ requestCPU:
+ description: The minimum amount of CPU required. Only used
+ for `pod` strategy
+ type: string
+ requestMemory:
+ description: The minimum amount of memory required. Only used
+ for `pod` strategy
+ type: string
+ strategy:
+ description: the strategy to adopt
+ enum:
+ - routine
+ - pod
+ type: string
+ toolImage:
+ description: The container image to be used to run the build.
+ type: string
+ type: object
+ maven:
+ description: Maven configuration used to build the Camel/Camel-Quarkus
+ applications
+ properties:
+ caSecrets:
+ description: The Secrets name and key, containing the CA certificate(s)
+ used to connect to remote Maven repositories. It can contain
+ X.509 certificates, and PKCS#7 formatted certificate chains.
+ A JKS formatted keystore is automatically created to store
+ the CA certificate(s), and configured to be used as a trusted
+ certificate(s) by the Maven commands. Note that the root
+ CA certificates are also imported into the created keystore.
+ items:
+ description: SecretKeySelector selects a key of a Secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind, uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key must
+ be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: array
+ cliOptions:
+ description: The CLI options that are appended to the list
+ of arguments for Maven commands, e.g., `-V,--no-transfer-progress,-Dstyle.color=never`.
+ See https://maven.apache.org/ref/3.8.4/maven-embedder/cli.html.
+ items:
+ type: string
+ type: array
+ extension:
+ description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html.
+ items:
+ description: MavenArtifact defines a GAV (Group:Artifact:Version)
+ Maven artifact
+ properties:
+ artifactId:
+ description: Maven Artifact
+ type: string
+ groupId:
+ description: Maven Group
+ type: string
+ version:
+ description: Maven Version
+ type: string
+ required:
+ - artifactId
+ - groupId
+ type: object
+ type: array
+ localRepository:
+ description: The path of the local Maven repository.
+ type: string
+ properties:
+ additionalProperties:
+ type: string
+ description: The Maven properties.
+ type: object
+ settings:
+ description: A reference to the ConfigMap or Secret key that
+ contains the Maven settings.
+ properties:
+ configMapKeyRef:
+ description: Selects a key of a ConfigMap.
+ properties:
+ key:
+ description: The key to select.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the ConfigMap or its
+ key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ secretKeyRef:
+ description: Selects a key of a secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key
+ must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: object
+ settingsSecurity:
+ description: A reference to the ConfigMap or Secret key that
+ contains the security of the Maven settings.
+ properties:
+ configMapKeyRef:
+ description: Selects a key of a ConfigMap.
+ properties:
+ key:
+ description: The key to select.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the ConfigMap or its
+ key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ secretKeyRef:
+ description: Selects a key of a secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key
+ must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: object
+ type: object
+ maxRunningPipelines:
+ description: the maximum amount of parallel running pipelines
+ started by this operator instance
+ format: int32
+ type: integer
+ publishStrategy:
+ description: the strategy to adopt for publishing an Integration
+ container image
+ type: string
+ registry:
+ description: the image registry used to push/pull Integration
+ images
+ properties:
+ address:
+ description: the URI to access
+ type: string
+ ca:
+ description: the configmap which stores the Certificate Authority
+ type: string
+ insecure:
+ description: if the container registry is insecure (ie, http
+ only)
+ type: boolean
+ organization:
+ description: the registry organization
+ type: string
+ secret:
+ description: the secret where credentials are stored
+ type: string
+ type: object
+ runtimeProvider:
+ description: the runtime used. Likely Camel Quarkus (we used to
+ have main runtime which has been discontinued since version
+ 1.5)
+ type: string
+ runtimeVersion:
+ description: the Camel K Runtime dependency version
+ type: string
+ timeout:
+ description: how much time to wait before time out the pipeline
+ process
+ type: string
+ type: object
profile:
description: the profile you wish to use. It will apply certain traits
which are required by the specific profile chosen. It usually relates
diff --git a/pkg/apis/camel/v1/build_types.go b/pkg/apis/camel/v1/build_types.go
index 4e84cd899..6a7107df9 100644
--- a/pkg/apis/camel/v1/build_types.go
+++ b/pkg/apis/camel/v1/build_types.go
@@ -25,30 +25,27 @@ import (
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// Important: Run "make generate-deepcopy" to regenerate code after modifying this file
-// BuildSpec defines the Build operation to be executed
-type BuildSpec struct {
+// PipelineSpec defines the Build operation to be executed
+type PipelineSpec struct {
// The sequence of Build tasks to be performed as part of the Build execution.
Tasks []Task `json:"tasks,omitempty"`
- // The configuration that should be used to perform the Build.
- Configuration BuildConfiguration `json:"configuration,omitempty"`
- // The container image to be used to run the build.
- ToolImage string `json:"toolImage,omitempty"`
- // The namespace where to run the builder Pod (must be the same of the operator in charge of this Build reconciliation).
- BuilderPodNamespace string `json:"operatorNamespace,omitempty"`
- // Timeout defines the Build maximum execution duration.
- // The Build deadline is set to the Build start time plus the Timeout duration.
- // If the Build deadline is exceeded, the Build context is canceled,
+ // Timeout defines the Pipeline maximum execution duration.
+ // The Pipeline deadline is set to the Pipeline start time plus the Timeout duration.
+ // If the Pipeline deadline is exceeded, the Pipeline context is canceled,
// and its phase set to BuildPhaseFailed.
// +kubebuilder:validation:Format=duration
Timeout metav1.Duration `json:"timeout,omitempty"`
- // the maximum amount of parallel running builds started by this operator instance
- MaxRunningBuilds int32 `json:"maxRunningBuilds,omitempty"`
}
// Task represents the abstract task. Only one of the task should be configured to represent the specific task chosen.
type Task struct {
- // a BuilderTask (base task)
+ // Application building
+
+ // a BuilderTask, used to generate and package the project
Builder *BuilderTask `json:"builder,omitempty"`
+
+ // Application Publishing
+
// a BuildahTask, for Buildah strategy
Buildah *BuildahTask `json:"buildah,omitempty"`
// a KanikoTask, for Kaniko strategy
@@ -57,6 +54,10 @@ type Task struct {
Spectrum *SpectrumTask `json:"spectrum,omitempty"`
// a S2iTask, for S2I strategy
S2i *S2iTask `json:"s2i,omitempty"`
+
+ // User customizable task execution
+
+ Custom *UserTask `json:"custom,omitempty"`
}
// BaseTask is a base for the struct hierarchy
@@ -68,6 +69,8 @@ type BaseTask struct {
// BuilderTask is the generic task in charge of building the application image
type BuilderTask struct {
BaseTask `json:",inline"`
+ // The configuration that should be used to perform the Build.
+ Configuration BuildConfiguration `json:"configuration,omitempty"`
// the base image layer
BaseImage string `json:"baseImage,omitempty"`
// the configuration required for the runtime application
@@ -153,6 +156,15 @@ type S2iTask struct {
Tag string `json:"tag,omitempty"`
}
+// UserTask is used to execute any generic custom operation
+type UserTask struct {
+ BaseTask `json:",inline"`
+ // the container image to use
+ ContainerImage string `json:"image,omitempty"`
+ // the command to execute
+ ContainerCommand string `json:"command,omitempty"`
+}
+
// BuildStatus defines the observed state of Build
type BuildStatus struct {
// ObservedGeneration is the most recent generation observed for this Build.
@@ -228,8 +240,8 @@ type Build struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
- Spec BuildSpec `json:"spec,omitempty"`
- Status BuildStatus `json:"status,omitempty"`
+ Spec PipelineSpec `json:"spec,omitempty"`
+ Status BuildStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
diff --git a/pkg/apis/camel/v1/build_types_support.go b/pkg/apis/camel/v1/build_types_support.go
index 6ca1829bb..d94b16e9c 100644
--- a/pkg/apis/camel/v1/build_types_support.go
+++ b/pkg/apis/camel/v1/build_types_support.go
@@ -44,9 +44,34 @@ func NewBuildList() BuildList {
}
}
-// OperatorNamespace returns the namespace of the operator in charge to reconcile this Build.
+// BuilderPodNamespace returns the namespace of the operator in charge to reconcile this Build.
func (build *Build) BuilderPodNamespace() string {
- return build.Spec.BuilderPodNamespace
+ for _, t := range build.Spec.Tasks {
+ if t.Builder != nil {
+ return t.Builder.Configuration.BuilderPodNamespace
+ }
+ }
+ return ""
+}
+
+// BuilderConfiguration returns the builder configuration for this Build.
+func (build *Build) BuilderConfiguration() *BuildConfiguration {
+ for _, t := range build.Spec.Tasks {
+ if t.Builder != nil {
+ return &t.Builder.Configuration
+ }
+ }
+ return &BuildConfiguration{}
+}
+
+// SetBuilderConfiguration set the configuration required for this Build.
+func (build *Build) SetBuilderConfiguration(conf *BuildConfiguration) {
+ for _, t := range build.Spec.Tasks {
+ if t.Builder != nil {
+ t.Builder.Configuration = *conf
+ return
+ }
+ }
}
func (buildPhase *BuildPhase) String() string {
diff --git a/pkg/apis/camel/v1/common_types.go b/pkg/apis/camel/v1/common_types.go
index d7ef30ad0..ede52e028 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -37,6 +37,10 @@ const (
// BuildConfiguration represent the configuration required to build the runtime
type BuildConfiguration struct {
+ // The container image to be used to run the build.
+ ToolImage string `json:"toolImage,omitempty"`
+ // The namespace where to run the builder Pod (must be the same of the operator in charge of this Build reconciliation).
+ BuilderPodNamespace string `json:"operatorNamespace,omitempty"`
// the strategy to adopt
Strategy BuildStrategy `property:"strategy" json:"strategy,omitempty"`
// The minimum amount of CPU required. Only used for `pod` strategy
diff --git a/pkg/apis/camel/v1/integrationplatform_types.go b/pkg/apis/camel/v1/integrationplatform_types.go
index 3244cacb9..bb03a7220 100644
--- a/pkg/apis/camel/v1/integrationplatform_types.go
+++ b/pkg/apis/camel/v1/integrationplatform_types.go
@@ -32,8 +32,11 @@ type IntegrationPlatformSpec struct {
// the profile you wish to use. It will apply certain traits which are required by the specific profile chosen.
// It usually relates the Cluster with the optional definition of special profiles (ie, Knative)
Profile TraitProfile `json:"profile,omitempty"`
+ // Deprecated: no longer used in Camel K version 2, maintained for backward compatibility with version 1.
// specify how to build the Integration/IntegrationKits
Build IntegrationPlatformBuildSpec `json:"build,omitempty"`
+ // specify how to build the Integration/IntegrationKits
+ Pipeline IntegrationPlatformPipelineSpec `json:"pipeline,omitempty"`
// list of traits to be executed for all the Integration/IntegrationKits built from this IntegrationPlatform
Traits Traits `json:"traits,omitempty"`
// Deprecated:
@@ -107,9 +110,10 @@ const (
// AllIntegrationPlatformClusters --
var AllIntegrationPlatformClusters = []IntegrationPlatformCluster{IntegrationPlatformClusterOpenShift, IntegrationPlatformClusterKubernetes}
-// IntegrationPlatformBuildSpec contains platform related build information.
+// IntegrationPlatformBuildSpec contains platform related pipeline information.
// This configuration can be used to tune the behavior of the Integration/IntegrationKit image builds.
// You can define the build strategy, the image registry to use and the Maven configuration to adopt.
+// Deprecated: use IntegrationPlatformPipelineSpec instead.
type IntegrationPlatformBuildSpec struct {
// the configuration required to build an Integration container image
BuildConfiguration BuildConfiguration `json:"buildConfiguration,omitempty"`
@@ -126,16 +130,45 @@ type IntegrationPlatformBuildSpec struct {
Registry RegistrySpec `json:"registry,omitempty"`
// the timeout (in seconds) to use when creating the build tools container image
BuildCatalogToolTimeout *metav1.Duration `json:"buildCatalogToolTimeout,omitempty"`
- // how much time to wait before time out the build process
+ // how much time to wait before time out the pipeline process
Timeout *metav1.Duration `json:"timeout,omitempty"`
// Maven configuration used to build the Camel/Camel-Quarkus applications
Maven MavenSpec `json:"maven,omitempty"`
- // Generic options that can used by each publish strategy
+ // Generic options that can used by any publish strategy
PublishStrategyOptions map[string]string `json:"PublishStrategyOptions,omitempty"`
- // the maximum amount of parallel running builds started by this operator instance
+ // the maximum amount of parallel running pipelines started by this operator instance
MaxRunningBuilds int32 `json:"maxRunningBuilds,omitempty"`
}
+// IntegrationPlatformPipelineSpec contains platform related pipeline information.
+// This configuration can be used to tune the behavior of the Integration/IntegrationKit image builds.
+// You can define the build strategy, the image registry to use and the Maven configuration to adopt.
+type IntegrationPlatformPipelineSpec struct {
+ // the configuration required to build an Integration container image
+ BuildConfiguration BuildConfiguration `json:"buildConfiguration,omitempty"`
+ // the strategy to adopt for publishing an Integration container image
+ PublishStrategy IntegrationPlatformBuildPublishStrategy `json:"publishStrategy,omitempty"`
+ // the Camel K Runtime dependency version
+ RuntimeVersion string `json:"runtimeVersion,omitempty"`
+ // the runtime used. Likely Camel Quarkus (we used to have main runtime which has been discontinued since version 1.5)
+ RuntimeProvider RuntimeProvider `json:"runtimeProvider,omitempty"`
+ // a base image that can be used as base layer for all images.
+ // It can be useful if you want to provide some custom base image with further utility softwares
+ BaseImage string `json:"baseImage,omitempty"`
+ // the image registry used to push/pull Integration images
+ Registry RegistrySpec `json:"registry,omitempty"`
+ // the timeout (in seconds) to use when creating the build tools container image
+ BuildCatalogToolTimeout *metav1.Duration `json:"buildCatalogToolTimeout,omitempty"`
+ // how much time to wait before time out the pipeline process
+ Timeout *metav1.Duration `json:"timeout,omitempty"`
+ // Maven configuration used to build the Camel/Camel-Quarkus applications
+ Maven MavenSpec `json:"maven,omitempty"`
+ // Generic options that can used by any publish strategy
+ PublishStrategyOptions map[string]string `json:"PublishStrategyOptions,omitempty"`
+ // the maximum amount of parallel running pipelines started by this operator instance
+ MaxRunningPipelines int32 `json:"maxRunningPipelines,omitempty"`
+}
+
// IntegrationPlatformKameletSpec define the behavior for all the Kamelets controller by the IntegrationPlatform
type IntegrationPlatformKameletSpec struct {
// remote repository used to retrieve Kamelet catalog
diff --git a/pkg/apis/camel/v1/integrationplatform_types_support.go b/pkg/apis/camel/v1/integrationplatform_types_support.go
index 599f40ef7..62a5588e8 100644
--- a/pkg/apis/camel/v1/integrationplatform_types_support.go
+++ b/pkg/apis/camel/v1/integrationplatform_types_support.go
@@ -174,7 +174,7 @@ func (in *IntegrationPlatformStatus) RemoveCondition(condType IntegrationPlatfor
}
// IsOptionEnabled tells if provided option key is present in PublishStrategyOptions and enabled
-func (b IntegrationPlatformBuildSpec) IsOptionEnabled(option string) bool {
+func (b IntegrationPlatformPipelineSpec) IsOptionEnabled(option string) bool {
//Key defined in builder/kaniko.go
if enabled, ok := b.PublishStrategyOptions[option]; ok {
res, err := strconv.ParseBool(enabled)
@@ -187,7 +187,7 @@ func (b IntegrationPlatformBuildSpec) IsOptionEnabled(option string) bool {
}
// AddOption add a publish strategy option
-func (b *IntegrationPlatformBuildSpec) AddOption(option string, value string) {
+func (b *IntegrationPlatformPipelineSpec) AddOption(option string, value string) {
options := b.PublishStrategyOptions
if options == nil {
options = make(map[string]string)
@@ -197,7 +197,7 @@ func (b *IntegrationPlatformBuildSpec) AddOption(option string, value string) {
}
// GetTimeout returns the specified duration or a default one
-func (b IntegrationPlatformBuildSpec) GetTimeout() metav1.Duration {
+func (b IntegrationPlatformPipelineSpec) GetTimeout() metav1.Duration {
if b.Timeout == nil {
return metav1.Duration{}
}
@@ -205,7 +205,7 @@ func (b IntegrationPlatformBuildSpec) GetTimeout() metav1.Duration {
}
// GetBuildCatalogToolTimeout returns the specified duration or a default one
-func (b IntegrationPlatformBuildSpec) GetBuildCatalogToolTimeout() metav1.Duration {
+func (b IntegrationPlatformPipelineSpec) GetBuildCatalogToolTimeout() metav1.Duration {
if b.BuildCatalogToolTimeout == nil {
return metav1.Duration{}
}
diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go b/pkg/apis/camel/v1/zz_generated.deepcopy.go
index b34d8ed9d..f43cacaa4 100644
--- a/pkg/apis/camel/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go
@@ -174,30 +174,6 @@ func (in *BuildList) DeepCopyObject() runtime.Object {
return nil
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *BuildSpec) DeepCopyInto(out *BuildSpec) {
- *out = *in
- if in.Tasks != nil {
- in, out := &in.Tasks, &out.Tasks
- *out = make([]Task, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- out.Configuration = in.Configuration
- out.Timeout = in.Timeout
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuildSpec.
-func (in *BuildSpec) DeepCopy() *BuildSpec {
- if in == nil {
- return nil
- }
- out := new(BuildSpec)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *BuildStatus) DeepCopyInto(out *BuildStatus) {
*out = *in
@@ -260,6 +236,7 @@ func (in *BuildahTask) DeepCopy() *BuildahTask {
func (in *BuilderTask) DeepCopyInto(out *BuilderTask) {
*out = *in
out.BaseTask = in.BaseTask
+ out.Configuration = in.Configuration
in.Runtime.DeepCopyInto(&out.Runtime)
if in.Dependencies != nil {
in, out := &in.Dependencies, &out.Dependencies
@@ -1424,10 +1401,46 @@ func (in *IntegrationPlatformList) DeepCopyObject() runtime.Object {
return nil
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *IntegrationPlatformPipelineSpec) DeepCopyInto(out *IntegrationPlatformPipelineSpec) {
+ *out = *in
+ out.BuildConfiguration = in.BuildConfiguration
+ out.Registry = in.Registry
+ if in.BuildCatalogToolTimeout != nil {
+ in, out := &in.BuildCatalogToolTimeout, &out.BuildCatalogToolTimeout
+ *out = new(metav1.Duration)
+ **out = **in
+ }
+ if in.Timeout != nil {
+ in, out := &in.Timeout, &out.Timeout
+ *out = new(metav1.Duration)
+ **out = **in
+ }
+ in.Maven.DeepCopyInto(&out.Maven)
+ if in.PublishStrategyOptions != nil {
+ in, out := &in.PublishStrategyOptions, &out.PublishStrategyOptions
+ *out = make(map[string]string, len(*in))
+ for key, val := range *in {
+ (*out)[key] = val
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationPlatformPipelineSpec.
+func (in *IntegrationPlatformPipelineSpec) DeepCopy() *IntegrationPlatformPipelineSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(IntegrationPlatformPipelineSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *IntegrationPlatformSpec) DeepCopyInto(out *IntegrationPlatformSpec) {
*out = *in
in.Build.DeepCopyInto(&out.Build)
+ in.Pipeline.DeepCopyInto(&out.Pipeline)
in.Traits.DeepCopyInto(&out.Traits)
if in.Configuration != nil {
in, out := &in.Configuration, &out.Configuration
@@ -2179,6 +2192,29 @@ func (in *PipeStatus) DeepCopy() *PipeStatus {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PipelineSpec) DeepCopyInto(out *PipelineSpec) {
+ *out = *in
+ if in.Tasks != nil {
+ in, out := &in.Tasks, &out.Tasks
+ *out = make([]Task, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ out.Timeout = in.Timeout
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineSpec.
+func (in *PipelineSpec) DeepCopy() *PipelineSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(PipelineSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in PluginProperties) DeepCopyInto(out *PluginProperties) {
{
@@ -2576,6 +2612,11 @@ func (in *Task) DeepCopyInto(out *Task) {
*out = new(S2iTask)
**out = **in
}
+ if in.Custom != nil {
+ in, out := &in.Custom, &out.Custom
+ *out = new(UserTask)
+ **out = **in
+ }
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Task.
@@ -2861,6 +2902,22 @@ func (in *Traits) DeepCopy() *Traits {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *UserTask) DeepCopyInto(out *UserTask) {
+ *out = *in
+ out.BaseTask = in.BaseTask
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserTask.
+func (in *UserTask) DeepCopy() *UserTask {
+ if in == nil {
+ return nil
+ }
+ out := new(UserTask)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ValueSource) DeepCopyInto(out *ValueSource) {
*out = *in
diff --git a/pkg/builder/builder_test.go b/pkg/builder/builder_test.go
index 8ff60bd54..f1f7fa723 100644
--- a/pkg/builder/builder_test.go
+++ b/pkg/builder/builder_test.go
@@ -51,7 +51,7 @@ func TestFailure(t *testing.T) {
registerSteps(steps)
build := &v1.Build{
- Spec: v1.BuildSpec{
+ Spec: v1.PipelineSpec{
Tasks: []v1.Task{
{
Builder: &v1.BuilderTask{
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/build.go b/pkg/client/camel/applyconfiguration/camel/v1/build.go
index 7f4dbc514..5cb419e90 100644
--- a/pkg/client/camel/applyconfiguration/camel/v1/build.go
+++ b/pkg/client/camel/applyconfiguration/camel/v1/build.go
@@ -30,8 +30,8 @@ import (
type BuildApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
- Spec *BuildSpecApplyConfiguration `json:"spec,omitempty"`
- Status *BuildStatusApplyConfiguration `json:"status,omitempty"`
+ Spec *PipelineSpecApplyConfiguration `json:"spec,omitempty"`
+ Status *BuildStatusApplyConfiguration `json:"status,omitempty"`
}
// Build constructs an declarative configuration of the Build type for use with
@@ -206,7 +206,7 @@ func (b *BuildApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
// WithSpec sets the Spec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Spec field is set to the value of the last call.
-func (b *BuildApplyConfiguration) WithSpec(value *BuildSpecApplyConfiguration) *BuildApplyConfiguration {
+func (b *BuildApplyConfiguration) WithSpec(value *PipelineSpecApplyConfiguration) *BuildApplyConfiguration {
b.Spec = value
return b
}
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/buildconfiguration.go b/pkg/client/camel/applyconfiguration/camel/v1/buildconfiguration.go
index 5dbd927a8..581db6aa5 100644
--- a/pkg/client/camel/applyconfiguration/camel/v1/buildconfiguration.go
+++ b/pkg/client/camel/applyconfiguration/camel/v1/buildconfiguration.go
@@ -26,11 +26,13 @@ import (
// BuildConfigurationApplyConfiguration represents an declarative configuration of the BuildConfiguration type for use
// with apply.
type BuildConfigurationApplyConfiguration struct {
- Strategy *v1.BuildStrategy `json:"strategy,omitempty"`
- RequestCPU *string `json:"requestCPU,omitempty"`
- RequestMemory *string `json:"requestMemory,omitempty"`
- LimitCPU *string `json:"limitCPU,omitempty"`
- LimitMemory *string `json:"limitMemory,omitempty"`
+ ToolImage *string `json:"toolImage,omitempty"`
+ BuilderPodNamespace *string `json:"operatorNamespace,omitempty"`
+ Strategy *v1.BuildStrategy `json:"strategy,omitempty"`
+ RequestCPU *string `json:"requestCPU,omitempty"`
+ RequestMemory *string `json:"requestMemory,omitempty"`
+ LimitCPU *string `json:"limitCPU,omitempty"`
+ LimitMemory *string `json:"limitMemory,omitempty"`
}
// BuildConfigurationApplyConfiguration constructs an declarative configuration of the BuildConfiguration type for use with
@@ -39,6 +41,22 @@ func BuildConfiguration() *BuildConfigurationApplyConfiguration {
return &BuildConfigurationApplyConfiguration{}
}
+// WithToolImage sets the ToolImage field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ToolImage field is set to the value of the last call.
+func (b *BuildConfigurationApplyConfiguration) WithToolImage(value string) *BuildConfigurationApplyConfiguration {
+ b.ToolImage = &value
+ return b
+}
+
+// WithBuilderPodNamespace sets the BuilderPodNamespace field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the BuilderPodNamespace field is set to the value of the last call.
+func (b *BuildConfigurationApplyConfiguration) WithBuilderPodNamespace(value string) *BuildConfigurationApplyConfiguration {
+ b.BuilderPodNamespace = &value
+ return b
+}
+
// WithStrategy sets the Strategy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Strategy field is set to the value of the last call.
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/buildertask.go b/pkg/client/camel/applyconfiguration/camel/v1/buildertask.go
index ceea83625..8198337eb 100644
--- a/pkg/client/camel/applyconfiguration/camel/v1/buildertask.go
+++ b/pkg/client/camel/applyconfiguration/camel/v1/buildertask.go
@@ -23,13 +23,14 @@ package v1
// with apply.
type BuilderTaskApplyConfiguration struct {
BaseTaskApplyConfiguration `json:",inline"`
- BaseImage *string `json:"baseImage,omitempty"`
- Runtime *RuntimeSpecApplyConfiguration `json:"runtime,omitempty"`
- Dependencies []string `json:"dependencies,omitempty"`
- Steps []string `json:"steps,omitempty"`
- Maven *MavenBuildSpecApplyConfiguration `json:"maven,omitempty"`
- BuildDir *string `json:"buildDir,omitempty"`
- Sources []SourceSpecApplyConfiguration `json:"sources,omitempty"`
+ Configuration *BuildConfigurationApplyConfiguration `json:"configuration,omitempty"`
+ BaseImage *string `json:"baseImage,omitempty"`
+ Runtime *RuntimeSpecApplyConfiguration `json:"runtime,omitempty"`
+ Dependencies []string `json:"dependencies,omitempty"`
+ Steps []string `json:"steps,omitempty"`
+ Maven *MavenBuildSpecApplyConfiguration `json:"maven,omitempty"`
+ BuildDir *string `json:"buildDir,omitempty"`
+ Sources []SourceSpecApplyConfiguration `json:"sources,omitempty"`
}
// BuilderTaskApplyConfiguration constructs an declarative configuration of the BuilderTask type for use with
@@ -46,6 +47,14 @@ func (b *BuilderTaskApplyConfiguration) WithName(value string) *BuilderTaskApply
return b
}
+// WithConfiguration sets the Configuration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Configuration field is set to the value of the last call.
+func (b *BuilderTaskApplyConfiguration) WithConfiguration(value *BuildConfigurationApplyConfiguration) *BuilderTaskApplyConfiguration {
+ b.Configuration = value
+ return b
+}
+
// WithBaseImage sets the BaseImage field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the BaseImage field is set to the value of the last call.
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/integrationplatformpipelinespec.go b/pkg/client/camel/applyconfiguration/camel/v1/integrationplatformpipelinespec.go
new file mode 100644
index 000000000..bba428093
--- /dev/null
+++ b/pkg/client/camel/applyconfiguration/camel/v1/integrationplatformpipelinespec.go
@@ -0,0 +1,141 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// IntegrationPlatformPipelineSpecApplyConfiguration represents an declarative configuration of the IntegrationPlatformPipelineSpec type for use
+// with apply.
+type IntegrationPlatformPipelineSpecApplyConfiguration struct {
+ BuildConfiguration *BuildConfigurationApplyConfiguration `json:"buildConfiguration,omitempty"`
+ PublishStrategy *camelv1.IntegrationPlatformBuildPublishStrategy `json:"publishStrategy,omitempty"`
+ RuntimeVersion *string `json:"runtimeVersion,omitempty"`
+ RuntimeProvider *camelv1.RuntimeProvider `json:"runtimeProvider,omitempty"`
+ BaseImage *string `json:"baseImage,omitempty"`
+ Registry *RegistrySpecApplyConfiguration `json:"registry,omitempty"`
+ BuildCatalogToolTimeout *metav1.Duration `json:"buildCatalogToolTimeout,omitempty"`
+ Timeout *metav1.Duration `json:"timeout,omitempty"`
+ Maven *MavenSpecApplyConfiguration `json:"maven,omitempty"`
+ PublishStrategyOptions map[string]string `json:"PublishStrategyOptions,omitempty"`
+ MaxRunningPipelines *int32 `json:"maxRunningPipelines,omitempty"`
+}
+
+// IntegrationPlatformPipelineSpecApplyConfiguration constructs an declarative configuration of the IntegrationPlatformPipelineSpec type for use with
+// apply.
+func IntegrationPlatformPipelineSpec() *IntegrationPlatformPipelineSpecApplyConfiguration {
+ return &IntegrationPlatformPipelineSpecApplyConfiguration{}
+}
+
+// WithBuildConfiguration sets the BuildConfiguration field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the BuildConfiguration field is set to the value of the last call.
+func (b *IntegrationPlatformPipelineSpecApplyConfiguration) WithBuildConfiguration(value *BuildConfigurationApplyConfiguration) *IntegrationPlatformPipelineSpecApplyConfiguration {
+ b.BuildConfiguration = value
+ return b
+}
+
+// WithPublishStrategy sets the PublishStrategy field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the PublishStrategy field is set to the value of the last call.
+func (b *IntegrationPlatformPipelineSpecApplyConfiguration) WithPublishStrategy(value camelv1.IntegrationPlatformBuildPublishStrategy) *IntegrationPlatformPipelineSpecApplyConfiguration {
+ b.PublishStrategy = &value
+ return b
+}
+
+// WithRuntimeVersion sets the RuntimeVersion field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the RuntimeVersion field is set to the value of the last call.
+func (b *IntegrationPlatformPipelineSpecApplyConfiguration) WithRuntimeVersion(value string) *IntegrationPlatformPipelineSpecApplyConfiguration {
+ b.RuntimeVersion = &value
+ return b
+}
+
+// WithRuntimeProvider sets the RuntimeProvider field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the RuntimeProvider field is set to the value of the last call.
+func (b *IntegrationPlatformPipelineSpecApplyConfiguration) WithRuntimeProvider(value camelv1.RuntimeProvider) *IntegrationPlatformPipelineSpecApplyConfiguration {
+ b.RuntimeProvider = &value
+ return b
+}
+
+// WithBaseImage sets the BaseImage field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the BaseImage field is set to the value of the last call.
+func (b *IntegrationPlatformPipelineSpecApplyConfiguration) WithBaseImage(value string) *IntegrationPlatformPipelineSpecApplyConfiguration {
+ b.BaseImage = &value
+ return b
+}
+
+// WithRegistry sets the Registry field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Registry field is set to the value of the last call.
+func (b *IntegrationPlatformPipelineSpecApplyConfiguration) WithRegistry(value *RegistrySpecApplyConfiguration) *IntegrationPlatformPipelineSpecApplyConfiguration {
+ b.Registry = value
+ return b
+}
+
+// WithBuildCatalogToolTimeout sets the BuildCatalogToolTimeout field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the BuildCatalogToolTimeout field is set to the value of the last call.
+func (b *IntegrationPlatformPipelineSpecApplyConfiguration) WithBuildCatalogToolTimeout(value metav1.Duration) *IntegrationPlatformPipelineSpecApplyConfiguration {
+ b.BuildCatalogToolTimeout = &value
+ return b
+}
+
+// WithTimeout sets the Timeout field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Timeout field is set to the value of the last call.
+func (b *IntegrationPlatformPipelineSpecApplyConfiguration) WithTimeout(value metav1.Duration) *IntegrationPlatformPipelineSpecApplyConfiguration {
+ b.Timeout = &value
+ return b
+}
+
+// WithMaven sets the Maven field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Maven field is set to the value of the last call.
+func (b *IntegrationPlatformPipelineSpecApplyConfiguration) WithMaven(value *MavenSpecApplyConfiguration) *IntegrationPlatformPipelineSpecApplyConfiguration {
+ b.Maven = value
+ return b
+}
+
+// WithPublishStrategyOptions puts the entries into the PublishStrategyOptions field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, the entries provided by each call will be put on the PublishStrategyOptions field,
+// overwriting an existing map entries in PublishStrategyOptions field with the same key.
+func (b *IntegrationPlatformPipelineSpecApplyConfiguration) WithPublishStrategyOptions(entries map[string]string) *IntegrationPlatformPipelineSpecApplyConfiguration {
+ if b.PublishStrategyOptions == nil && len(entries) > 0 {
+ b.PublishStrategyOptions = make(map[string]string, len(entries))
+ }
+ for k, v := range entries {
+ b.PublishStrategyOptions[k] = v
+ }
+ return b
+}
+
+// WithMaxRunningPipelines sets the MaxRunningPipelines field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the MaxRunningPipelines field is set to the value of the last call.
+func (b *IntegrationPlatformPipelineSpecApplyConfiguration) WithMaxRunningPipelines(value int32) *IntegrationPlatformPipelineSpecApplyConfiguration {
+ b.MaxRunningPipelines = &value
+ return b
+}
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/integrationplatformspec.go b/pkg/client/camel/applyconfiguration/camel/v1/integrationplatformspec.go
index 7baaa7bbd..12e4a4611 100644
--- a/pkg/client/camel/applyconfiguration/camel/v1/integrationplatformspec.go
+++ b/pkg/client/camel/applyconfiguration/camel/v1/integrationplatformspec.go
@@ -26,12 +26,13 @@ import (
// IntegrationPlatformSpecApplyConfiguration represents an declarative configuration of the IntegrationPlatformSpec type for use
// with apply.
type IntegrationPlatformSpecApplyConfiguration struct {
- Cluster *v1.IntegrationPlatformCluster `json:"cluster,omitempty"`
- Profile *v1.TraitProfile `json:"profile,omitempty"`
- Build *IntegrationPlatformBuildSpecApplyConfiguration `json:"build,omitempty"`
- Traits *TraitsApplyConfiguration `json:"traits,omitempty"`
- Configuration []ConfigurationSpecApplyConfiguration `json:"configuration,omitempty"`
- Kamelet *IntegrationPlatformKameletSpecApplyConfiguration `json:"kamelet,omitempty"`
+ Cluster *v1.IntegrationPlatformCluster `json:"cluster,omitempty"`
+ Profile *v1.TraitProfile `json:"profile,omitempty"`
+ Build *IntegrationPlatformBuildSpecApplyConfiguration `json:"build,omitempty"`
+ Pipeline *IntegrationPlatformPipelineSpecApplyConfiguration `json:"pipeline,omitempty"`
+ Traits *TraitsApplyConfiguration `json:"traits,omitempty"`
+ Configuration []ConfigurationSpecApplyConfiguration `json:"configuration,omitempty"`
+ Kamelet *IntegrationPlatformKameletSpecApplyConfiguration `json:"kamelet,omitempty"`
}
// IntegrationPlatformSpecApplyConfiguration constructs an declarative configuration of the IntegrationPlatformSpec type for use with
@@ -64,6 +65,14 @@ func (b *IntegrationPlatformSpecApplyConfiguration) WithBuild(value *Integration
return b
}
+// WithPipeline sets the Pipeline field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Pipeline field is set to the value of the last call.
+func (b *IntegrationPlatformSpecApplyConfiguration) WithPipeline(value *IntegrationPlatformPipelineSpecApplyConfiguration) *IntegrationPlatformSpecApplyConfiguration {
+ b.Pipeline = value
+ return b
+}
+
// WithTraits sets the Traits field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Traits field is set to the value of the last call.
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/integrationplatformstatus.go b/pkg/client/camel/applyconfiguration/camel/v1/integrationplatformstatus.go
index c14284f7d..c95398665 100644
--- a/pkg/client/camel/applyconfiguration/camel/v1/integrationplatformstatus.go
+++ b/pkg/client/camel/applyconfiguration/camel/v1/integrationplatformstatus.go
@@ -64,6 +64,14 @@ func (b *IntegrationPlatformStatusApplyConfiguration) WithBuild(value *Integrati
return b
}
+// WithPipeline sets the Pipeline field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Pipeline field is set to the value of the last call.
+func (b *IntegrationPlatformStatusApplyConfiguration) WithPipeline(value *IntegrationPlatformPipelineSpecApplyConfiguration) *IntegrationPlatformStatusApplyConfiguration {
+ b.Pipeline = value
+ return b
+}
+
// WithTraits sets the Traits field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Traits field is set to the value of the last call.
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/pipelinespec.go b/pkg/client/camel/applyconfiguration/camel/v1/pipelinespec.go
new file mode 100644
index 000000000..5a8393f1e
--- /dev/null
+++ b/pkg/client/camel/applyconfiguration/camel/v1/pipelinespec.go
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// PipelineSpecApplyConfiguration represents an declarative configuration of the PipelineSpec type for use
+// with apply.
+type PipelineSpecApplyConfiguration struct {
+ Tasks []TaskApplyConfiguration `json:"tasks,omitempty"`
+ Timeout *metav1.Duration `json:"timeout,omitempty"`
+}
+
+// PipelineSpecApplyConfiguration constructs an declarative configuration of the PipelineSpec type for use with
+// apply.
+func PipelineSpec() *PipelineSpecApplyConfiguration {
+ return &PipelineSpecApplyConfiguration{}
+}
+
+// WithTasks adds the given value to the Tasks field in the declarative configuration
+// and returns the receiver, so that objects can be build by chaining "With" function invocations.
+// If called multiple times, values provided by each call will be appended to the Tasks field.
+func (b *PipelineSpecApplyConfiguration) WithTasks(values ...*TaskApplyConfiguration) *PipelineSpecApplyConfiguration {
+ for i := range values {
+ if values[i] == nil {
+ panic("nil value passed to WithTasks")
+ }
+ b.Tasks = append(b.Tasks, *values[i])
+ }
+ return b
+}
+
+// WithTimeout sets the Timeout field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Timeout field is set to the value of the last call.
+func (b *PipelineSpecApplyConfiguration) WithTimeout(value metav1.Duration) *PipelineSpecApplyConfiguration {
+ b.Timeout = &value
+ return b
+}
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/task.go b/pkg/client/camel/applyconfiguration/camel/v1/task.go
index 5f8266e50..01fd1aa5a 100644
--- a/pkg/client/camel/applyconfiguration/camel/v1/task.go
+++ b/pkg/client/camel/applyconfiguration/camel/v1/task.go
@@ -27,6 +27,7 @@ type TaskApplyConfiguration struct {
Kaniko *KanikoTaskApplyConfiguration `json:"kaniko,omitempty"`
Spectrum *SpectrumTaskApplyConfiguration `json:"spectrum,omitempty"`
S2i *S2iTaskApplyConfiguration `json:"s2i,omitempty"`
+ Custom *UserTaskApplyConfiguration `json:"custom,omitempty"`
}
// TaskApplyConfiguration constructs an declarative configuration of the Task type for use with
@@ -74,3 +75,11 @@ func (b *TaskApplyConfiguration) WithS2i(value *S2iTaskApplyConfiguration) *Task
b.S2i = value
return b
}
+
+// WithCustom sets the Custom field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Custom field is set to the value of the last call.
+func (b *TaskApplyConfiguration) WithCustom(value *UserTaskApplyConfiguration) *TaskApplyConfiguration {
+ b.Custom = value
+ return b
+}
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/usertask.go b/pkg/client/camel/applyconfiguration/camel/v1/usertask.go
new file mode 100644
index 000000000..51dcadc4b
--- /dev/null
+++ b/pkg/client/camel/applyconfiguration/camel/v1/usertask.go
@@ -0,0 +1,58 @@
+/*
+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.
+*/
+
+// Code generated by applyconfiguration-gen. DO NOT EDIT.
+
+package v1
+
+// UserTaskApplyConfiguration represents an declarative configuration of the UserTask type for use
+// with apply.
+type UserTaskApplyConfiguration struct {
+ BaseTaskApplyConfiguration `json:",inline"`
+ ContainerImage *string `json:"image,omitempty"`
+ ContainerCommand *string `json:"command,omitempty"`
+}
+
+// UserTaskApplyConfiguration constructs an declarative configuration of the UserTask type for use with
+// apply.
+func UserTask() *UserTaskApplyConfiguration {
+ return &UserTaskApplyConfiguration{}
+}
+
+// WithName sets the Name field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the Name field is set to the value of the last call.
+func (b *UserTaskApplyConfiguration) WithName(value string) *UserTaskApplyConfiguration {
+ b.Name = &value
+ return b
+}
+
+// WithContainerImage sets the ContainerImage field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ContainerImage field is set to the value of the last call.
+func (b *UserTaskApplyConfiguration) WithContainerImage(value string) *UserTaskApplyConfiguration {
+ b.ContainerImage = &value
+ return b
+}
+
+// WithContainerCommand sets the ContainerCommand field in the declarative configuration to the given value
+// and returns the receiver, so that objects can be built by chaining "With" function invocations.
+// If called multiple times, the ContainerCommand field is set to the value of the last call.
+func (b *UserTaskApplyConfiguration) WithContainerCommand(value string) *UserTaskApplyConfiguration {
+ b.ContainerCommand = &value
+ return b
+}
diff --git a/pkg/client/camel/applyconfiguration/utils.go b/pkg/client/camel/applyconfiguration/utils.go
index ab9537c95..d9aaef778 100644
--- a/pkg/client/camel/applyconfiguration/utils.go
+++ b/pkg/client/camel/applyconfiguration/utils.go
@@ -48,8 +48,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &camelv1.BuildConfigurationApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("BuilderTask"):
return &camelv1.BuilderTaskApplyConfiguration{}
- case v1.SchemeGroupVersion.WithKind("BuildSpec"):
- return &camelv1.BuildSpecApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("BuildStatus"):
return &camelv1.BuildStatusApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("CamelArtifact"):
@@ -128,6 +126,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &camelv1.IntegrationPlatformKameletRepositorySpecApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("IntegrationPlatformKameletSpec"):
return &camelv1.IntegrationPlatformKameletSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("IntegrationPlatformPipelineSpec"):
+ return &camelv1.IntegrationPlatformPipelineSpecApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("IntegrationPlatformSpec"):
return &camelv1.IntegrationPlatformSpecApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("IntegrationPlatformStatus"):
@@ -166,6 +166,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &camelv1.PipeApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("PipeCondition"):
return &camelv1.PipeConditionApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("PipelineSpec"):
+ return &camelv1.PipelineSpecApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("PipeSpec"):
return &camelv1.PipeSpecApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("PipeStatus"):
@@ -204,6 +206,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &camelv1.TraitsApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("TraitSpec"):
return &camelv1.TraitSpecApplyConfiguration{}
+ case v1.SchemeGroupVersion.WithKind("UserTask"):
+ return &camelv1.UserTaskApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("ValueSource"):
return &camelv1.ValueSourceApplyConfiguration{}
diff --git a/pkg/client/camel/clientset/versioned/fake/register.go b/pkg/client/camel/clientset/versioned/fake/register.go
index 249a2b9e3..d55e6d595 100644
--- a/pkg/client/camel/clientset/versioned/fake/register.go
+++ b/pkg/client/camel/clientset/versioned/fake/register.go
@@ -40,14 +40,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
-// import (
-// "k8s.io/client-go/kubernetes"
-// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
-// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
-// )
+// import (
+// "k8s.io/client-go/kubernetes"
+// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
+// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
+// )
//
-// kclientset, _ := kubernetes.NewForConfig(c)
-// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
+// kclientset, _ := kubernetes.NewForConfig(c)
+// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
diff --git a/pkg/client/camel/clientset/versioned/scheme/register.go b/pkg/client/camel/clientset/versioned/scheme/register.go
index 9366fb20c..493d56e4c 100644
--- a/pkg/client/camel/clientset/versioned/scheme/register.go
+++ b/pkg/client/camel/clientset/versioned/scheme/register.go
@@ -40,14 +40,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
-// import (
-// "k8s.io/client-go/kubernetes"
-// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
-// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
-// )
+// import (
+// "k8s.io/client-go/kubernetes"
+// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
+// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
+// )
//
-// kclientset, _ := kubernetes.NewForConfig(c)
-// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
+// kclientset, _ := kubernetes.NewForConfig(c)
+// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
diff --git a/pkg/cmd/describe_platform.go b/pkg/cmd/describe_platform.go
index 9b716d8a5..be84b5fa5 100644
--- a/pkg/cmd/describe_platform.go
+++ b/pkg/cmd/describe_platform.go
@@ -108,17 +108,17 @@ func (command *describePlatformCommandOptions) describeIntegrationPlatform(cmd *
}
func getPlatformBaseImage(spec v1.IntegrationPlatformSpec) string {
- return spec.Build.BaseImage
+ return spec.Pipeline.BaseImage
}
func getPlatformRuntimeVersion(spec v1.IntegrationPlatformSpec) string {
- return spec.Build.RuntimeVersion
+ return spec.Pipeline.RuntimeVersion
}
func getPlatformMavenLocalRepository(spec v1.IntegrationPlatformSpec) string {
- return spec.Build.Maven.LocalRepository
+ return spec.Pipeline.Maven.LocalRepository
}
func getPlatformPublishStrategy(spec v1.IntegrationPlatformSpec) string {
- return string(spec.Build.PublishStrategy)
+ return string(spec.Pipeline.PublishStrategy)
}
diff --git a/pkg/cmd/install.go b/pkg/cmd/install.go
index ed391a98c..a777d41e0 100644
--- a/pkg/cmd/install.go
+++ b/pkg/cmd/install.go
@@ -146,7 +146,7 @@ func newCmdInstall(rootCmdOptions *RootCmdOptions) (*cobra.Command, *installCmdO
cmd.Flags().StringArray("operator-resources", nil, "Define the resources requests and limits assigned to the operator Pod as <requestType.requestResource=value> (i.e., limits.memory=256Mi)")
cmd.Flags().StringArray("operator-env-vars", nil, "Add an environment variable to set in the operator Pod(s), as <name=value>")
cmd.Flags().StringP("log-level", "z", "info", "The level of operator logging (default - info): info or 0, debug or 1")
- cmd.Flags().Int("max-running-builds", 0, "Maximum number of parallel running builds")
+ cmd.Flags().Int("max-running-pipelines", 0, "Maximum number of parallel running pipelines")
// save
cmd.Flags().Bool("save", false, "Save the install parameters into the default kamel configuration file (kamel-config.yaml)")
@@ -193,7 +193,7 @@ type installCmdOptions struct {
MavenCASecret string `mapstructure:"maven-ca-secret"`
MavenCLIOptions []string `mapstructure:"maven-cli-options"`
HealthPort int32 `mapstructure:"health-port"`
- MaxRunningBuilds int32 `mapstructure:"max-running-builds"`
+ MaxRunningPipelines int32 `mapstructure:"max-running-pipelines"`
Monitoring bool `mapstructure:"monitoring"`
MonitoringPort int32 `mapstructure:"monitoring-port"`
TraitProfile string `mapstructure:"trait-profile"`
@@ -473,21 +473,21 @@ func (o *installCmdOptions) setupIntegrationPlatform(c client.Client, namespace
}
if registrySecretName != "" {
- platform.Spec.Build.Registry.Secret = registrySecretName
+ platform.Spec.Pipeline.Registry.Secret = registrySecretName
}
if len(o.MavenProperties) > 0 {
- platform.Spec.Build.Maven.Properties = make(map[string]string)
+ platform.Spec.Pipeline.Maven.Properties = make(map[string]string)
for _, property := range o.MavenProperties {
kv := strings.Split(property, "=")
if len(kv) == 2 {
- platform.Spec.Build.Maven.Properties[kv[0]] = kv[1]
+ platform.Spec.Pipeline.Maven.Properties[kv[0]] = kv[1]
}
}
}
if size := len(o.MavenExtensions); size > 0 {
- platform.Spec.Build.Maven.Extension = make([]v1.MavenArtifact, 0, size)
+ platform.Spec.Pipeline.Maven.Extension = make([]v1.MavenArtifact, 0, size)
for _, extension := range o.MavenExtensions {
gav := strings.Split(extension, ":")
if len(gav) != 2 && len(gav) != 3 {
@@ -501,29 +501,29 @@ func (o *installCmdOptions) setupIntegrationPlatform(c client.Client, namespace
if len(gav) == 3 {
ext.Version = gav[2]
}
- platform.Spec.Build.Maven.Extension = append(platform.Spec.Build.Maven.Extension, ext)
+ platform.Spec.Pipeline.Maven.Extension = append(platform.Spec.Pipeline.Maven.Extension, ext)
}
}
if o.MavenLocalRepository != "" {
- platform.Spec.Build.Maven.LocalRepository = o.MavenLocalRepository
+ platform.Spec.Pipeline.Maven.LocalRepository = o.MavenLocalRepository
}
if len(o.MavenCLIOptions) > 0 {
- platform.Spec.Build.Maven.CLIOptions = o.MavenCLIOptions
+ platform.Spec.Pipeline.Maven.CLIOptions = o.MavenCLIOptions
}
if o.RuntimeVersion != "" {
- platform.Spec.Build.RuntimeVersion = o.RuntimeVersion
+ platform.Spec.Pipeline.RuntimeVersion = o.RuntimeVersion
}
if o.BaseImage != "" {
- platform.Spec.Build.BaseImage = o.BaseImage
+ platform.Spec.Pipeline.BaseImage = o.BaseImage
}
if o.BuildStrategy != "" {
- platform.Spec.Build.BuildConfiguration.Strategy = v1.BuildStrategy(o.BuildStrategy)
+ platform.Spec.Pipeline.BuildConfiguration.Strategy = v1.BuildStrategy(o.BuildStrategy)
}
if o.BuildPublishStrategy != "" {
- platform.Spec.Build.PublishStrategy = v1.IntegrationPlatformBuildPublishStrategy(o.BuildPublishStrategy)
+ platform.Spec.Pipeline.PublishStrategy = v1.IntegrationPlatformBuildPublishStrategy(o.BuildPublishStrategy)
}
if o.BuildTimeout != "" {
d, err := time.ParseDuration(o.BuildTimeout)
@@ -531,12 +531,12 @@ func (o *installCmdOptions) setupIntegrationPlatform(c client.Client, namespace
return nil, err
}
- platform.Spec.Build.Timeout = &metav1.Duration{
+ platform.Spec.Pipeline.Timeout = &metav1.Duration{
Duration: d,
}
}
- if o.MaxRunningBuilds > 0 {
- platform.Spec.Build.MaxRunningBuilds = o.MaxRunningBuilds
+ if o.MaxRunningPipelines > 0 {
+ platform.Spec.Pipeline.MaxRunningPipelines = o.MaxRunningPipelines
}
if o.TraitProfile != "" {
@@ -552,7 +552,7 @@ func (o *installCmdOptions) setupIntegrationPlatform(c client.Client, namespace
if err != nil {
return nil, err
}
- platform.Spec.Build.Maven.Settings.ConfigMapKeyRef = &corev1.ConfigMapKeySelector{
+ platform.Spec.Pipeline.Maven.Settings.ConfigMapKeyRef = &corev1.ConfigMapKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Name: platform.Name + "-maven-settings",
},
@@ -565,7 +565,7 @@ func (o *installCmdOptions) setupIntegrationPlatform(c client.Client, namespace
if err != nil {
return nil, err
}
- platform.Spec.Build.Maven.Settings = mavenSettings
+ platform.Spec.Pipeline.Maven.Settings = mavenSettings
}
if o.MavenCASecret != "" {
@@ -573,7 +573,7 @@ func (o *installCmdOptions) setupIntegrationPlatform(c client.Client, namespace
if err != nil {
return nil, err
}
- platform.Spec.Build.Maven.CASecrets = append(platform.Spec.Build.Maven.CASecrets, *secret)
+ platform.Spec.Pipeline.Maven.CASecrets = append(platform.Spec.Pipeline.Maven.CASecrets, *secret)
}
if o.ClusterType != "" {
@@ -584,7 +584,7 @@ func (o *installCmdOptions) setupIntegrationPlatform(c client.Client, namespace
}
}
if len(o.BuildPublishStrategyOptions) > 0 {
- if err = o.addBuildPublishStrategyOptions(&platform.Spec.Build); err != nil {
+ if err = o.addBuildPublishStrategyOptions(&platform.Spec.Pipeline); err != nil {
return nil, err
}
}
@@ -774,16 +774,16 @@ func (o *installCmdOptions) validate(_ *cobra.Command, _ []string) error {
return result
}
-// addBuildPublishStrategyOptions parses and adds all the build publish strategy options to the given IntegrationPlatformBuildSpec.
-func (o *installCmdOptions) addBuildPublishStrategyOptions(build *v1.IntegrationPlatformBuildSpec) error {
+// addBuildPublishStrategyOptions parses and adds all the build publish strategy options to the given IntegrationPlatformPipelineSpec.
+func (o *installCmdOptions) addBuildPublishStrategyOptions(pipeline *v1.IntegrationPlatformPipelineSpec) error {
for _, option := range o.BuildPublishStrategyOptions {
kv := strings.Split(option, "=")
if len(kv) == 2 {
key := kv[0]
- if builder.IsSupportedPublishStrategyOption(build.PublishStrategy, key) {
- build.AddOption(key, kv[1])
+ if builder.IsSupportedPublishStrategyOption(pipeline.PublishStrategy, key) {
+ pipeline.AddOption(key, kv[1])
} else {
- return fmt.Errorf("build publish strategy option '%s' not supported. %s", option, supportedOptionsAsString(build.PublishStrategy))
+ return fmt.Errorf("build publish strategy option '%s' not supported. %s", option, supportedOptionsAsString(pipeline.PublishStrategy))
}
} else {
return fmt.Errorf("build publish strategy option '%s' not in the expected format (name=value)", option)
diff --git a/pkg/cmd/promote_test.go b/pkg/cmd/promote_test.go
index d63543902..9c7c52f0d 100644
--- a/pkg/cmd/promote_test.go
+++ b/pkg/cmd/promote_test.go
@@ -55,11 +55,11 @@ func addTestPromoteCmd(options RootCmdOptions, rootCmd *cobra.Command) *promoteC
func TestIntegrationNotCompatible(t *testing.T) {
srcPlatform := v1.NewIntegrationPlatform("default", platform.DefaultPlatformName)
srcPlatform.Status.Version = defaults.Version
- srcPlatform.Status.Build.RuntimeVersion = defaults.DefaultRuntimeVersion
+ srcPlatform.Status.Pipeline.RuntimeVersion = defaults.DefaultRuntimeVersion
srcPlatform.Status.Phase = v1.IntegrationPlatformPhaseReady
dstPlatform := v1.NewIntegrationPlatform("prod-namespace", platform.DefaultPlatformName)
dstPlatform.Status.Version = "0.0.1"
- dstPlatform.Status.Build.RuntimeVersion = "0.0.1"
+ dstPlatform.Status.Pipeline.RuntimeVersion = "0.0.1"
dstPlatform.Status.Phase = v1.IntegrationPlatformPhaseReady
defaultIntegration := nominalIntegration("my-it-test")
srcCatalog := createTestCamelCatalog(srcPlatform)
@@ -78,11 +78,11 @@ func TestIntegrationNotCompatible(t *testing.T) {
func TestIntegrationDryRun(t *testing.T) {
srcPlatform := v1.NewIntegrationPlatform("default", platform.DefaultPlatformName)
srcPlatform.Status.Version = defaults.Version
- srcPlatform.Status.Build.RuntimeVersion = defaults.DefaultRuntimeVersion
+ srcPlatform.Status.Pipeline.RuntimeVersion = defaults.DefaultRuntimeVersion
srcPlatform.Status.Phase = v1.IntegrationPlatformPhaseReady
dstPlatform := v1.NewIntegrationPlatform("prod-namespace", platform.DefaultPlatformName)
dstPlatform.Status.Version = defaults.Version
- dstPlatform.Status.Build.RuntimeVersion = defaults.DefaultRuntimeVersion
+ dstPlatform.Status.Pipeline.RuntimeVersion = defaults.DefaultRuntimeVersion
dstPlatform.Status.Phase = v1.IntegrationPlatformPhaseReady
defaultIntegration := nominalIntegration("my-it-test")
srcCatalog := createTestCamelCatalog(srcPlatform)
@@ -116,11 +116,11 @@ func nominalIntegration(name string) v1.Integration {
func TestPipeDryRun(t *testing.T) {
srcPlatform := v1.NewIntegrationPlatform("default", platform.DefaultPlatformName)
srcPlatform.Status.Version = defaults.Version
- srcPlatform.Status.Build.RuntimeVersion = defaults.DefaultRuntimeVersion
+ srcPlatform.Status.Pipeline.RuntimeVersion = defaults.DefaultRuntimeVersion
srcPlatform.Status.Phase = v1.IntegrationPlatformPhaseReady
dstPlatform := v1.NewIntegrationPlatform("prod-namespace", platform.DefaultPlatformName)
dstPlatform.Status.Version = defaults.Version
- dstPlatform.Status.Build.RuntimeVersion = defaults.DefaultRuntimeVersion
+ dstPlatform.Status.Pipeline.RuntimeVersion = defaults.DefaultRuntimeVersion
dstPlatform.Status.Phase = v1.IntegrationPlatformPhaseReady
defaultKB := nominalPipe("my-kb-test")
defaultIntegration := nominalIntegration("my-kb-test")
@@ -157,6 +157,6 @@ func nominalPipe(name string) v1.Pipe {
func createTestCamelCatalog(platform v1.IntegrationPlatform) v1.CamelCatalog {
c := v1.NewCamelCatalog(platform.Namespace, defaults.DefaultRuntimeVersion)
- c.Spec = v1.CamelCatalogSpec{Runtime: v1.RuntimeSpec{Provider: platform.Status.Build.RuntimeProvider, Version: platform.Status.Build.RuntimeVersion}}
+ c.Spec = v1.CamelCatalogSpec{Runtime: v1.RuntimeSpec{Provider: platform.Status.Pipeline.RuntimeProvider, Version: platform.Status.Pipeline.RuntimeVersion}}
return c
}
diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go
index c2da4f6ad..1df538f17 100644
--- a/pkg/cmd/run.go
+++ b/pkg/cmd/run.go
@@ -842,12 +842,12 @@ func (o *runCmdOptions) getPlatform(cmd *cobra.Command, c client.Client, it *v1.
if err != nil {
return nil, err
}
- if ca := pl.Status.Build.Registry.CA; ca != "" {
+ if ca := pl.Status.Pipeline.Registry.CA; ca != "" {
o.PrintfVerboseOutf(cmd, "We've noticed the image registry is configured with a custom certificate [%s] \n", ca)
o.PrintVerboseOut(cmd, "Please make sure Kamel CLI is configured to use it or the operation will fail.")
o.PrintVerboseOut(cmd, "More information can be found here https://nodejs.org/api/cli.html#cli_node_extra_ca_certs_file")
}
- if secret := pl.Status.Build.Registry.Secret; secret != "" {
+ if secret := pl.Status.Pipeline.Registry.Secret; secret != "" {
o.PrintfVerboseOutf(cmd, "We've noticed the image registry is configured with a Secret [%s] \n", secret)
o.PrintVerboseOut(cmd, "Please configure Docker authentication correctly or the operation will fail (by default it's $HOME/.docker/config.json).")
o.PrintVerboseOut(cmd, "More information can be found here https://docs.docker.com/engine/reference/commandline/login/")
@@ -969,7 +969,7 @@ func (o *runCmdOptions) getRegistry(platform *v1.IntegrationPlatform) string {
if registry != "" {
return registry
}
- return platform.Status.Build.Registry.Address
+ return platform.Status.Pipeline.Registry.Address
}
func (o *runCmdOptions) skipChecksums() bool {
@@ -1269,7 +1269,7 @@ func writeChecksumToFile(filepath string, hash hash.Hash) error {
}
func (o *runCmdOptions) getSpectrumOptions(platform *v1.IntegrationPlatform, cmd *cobra.Command) spectrum.Options {
- insecure := platform.Status.Build.Registry.Insecure
+ insecure := platform.Status.Pipeline.Registry.Insecure
var stdout io.Writer
if o.Verbose {
stdout = cmd.OutOrStdout()
@@ -1294,7 +1294,7 @@ func getArtifactHTTPPath(dependency maven.Dependency, platform *v1.IntegrationPl
// Some vendors don't allow '/' or '.' in repository name so let's replace them with '_'
artifactHTTPPath = strings.ReplaceAll(artifactHTTPPath, "/", "_")
artifactHTTPPath = strings.ReplaceAll(artifactHTTPPath, ".", "_")
- organization := platform.Status.Build.Registry.Organization
+ organization := platform.Status.Pipeline.Registry.Organization
if organization == "" {
organization = ns
}
diff --git a/pkg/cmd/run_test.go b/pkg/cmd/run_test.go
index 1efbfd112..49d530f00 100644
--- a/pkg/cmd/run_test.go
+++ b/pkg/cmd/run_test.go
@@ -69,7 +69,7 @@ func initializeRunCmdOptionsWithOutput(t *testing.T) (*runCmdOptions, *cobra.Com
t.Helper()
defaultIntegrationPlatform := v1.NewIntegrationPlatform("default", platform.DefaultPlatformName)
c := v1.NewCamelCatalog(defaultIntegrationPlatform.Namespace, defaults.DefaultRuntimeVersion)
- c.Spec = v1.CamelCatalogSpec{Runtime: v1.RuntimeSpec{Provider: defaultIntegrationPlatform.Status.Build.RuntimeProvider, Version: defaultIntegrationPlatform.Status.Build.RuntimeVersion}}
+ c.Spec = v1.CamelCatalogSpec{Runtime: v1.RuntimeSpec{Provider: defaultIntegrationPlatform.Status.Pipeline.RuntimeProvider, Version: defaultIntegrationPlatform.Status.Pipeline.RuntimeVersion}}
fakeClient, _ := test.NewFakeClient(&defaultIntegrationPlatform, &c)
options, rootCmd := kamelTestPreAddCommandInitWithClient(fakeClient)
diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go
index 94607b4f1..2524afad8 100644
--- a/pkg/cmd/version.go
+++ b/pkg/cmd/version.go
@@ -143,12 +143,12 @@ func operatorInfo(ctx context.Context, c client.Client, namespace string) (map[s
infos["Name"] = platform.Name
infos["Version"] = platform.Status.Version
- infos["Publish strategy"] = string(platform.Status.Build.PublishStrategy)
- infos["Runtime version"] = platform.Status.Build.RuntimeVersion
- infos["Registry address"] = platform.Status.Build.Registry.Address
+ infos["Publish strategy"] = string(platform.Status.Pipeline.PublishStrategy)
+ infos["Runtime version"] = platform.Status.Pipeline.RuntimeVersion
+ infos["Registry address"] = platform.Status.Pipeline.Registry.Address
infos["Git commit"] = platform.Status.Info["gitCommit"]
- catalog, err := camel.LoadCatalog(ctx, c, namespace, v1.RuntimeSpec{Version: platform.Status.Build.RuntimeVersion, Provider: platform.Status.Build.RuntimeProvider})
+ catalog, err := camel.LoadCatalog(ctx, c, namespace, v1.RuntimeSpec{Version: platform.Status.Pipeline.RuntimeVersion, Provider: platform.Status.Pipeline.RuntimeProvider})
if err != nil {
return nil, err
}
diff --git a/pkg/cmd/version_test.go b/pkg/cmd/version_test.go
index 053e0dae8..d4d3a2215 100644
--- a/pkg/cmd/version_test.go
+++ b/pkg/cmd/version_test.go
@@ -85,10 +85,10 @@ func TestVersionClientVerbose(t *testing.T) {
func TestOperatorVersionVerbose(t *testing.T) {
platform := v1.NewIntegrationPlatform("default", platform.DefaultPlatformName)
platform.Status.Version = defaults.Version
- platform.Status.Build.RuntimeVersion = defaults.DefaultRuntimeVersion
+ platform.Status.Pipeline.RuntimeVersion = defaults.DefaultRuntimeVersion
platform.Status.Phase = v1.IntegrationPlatformPhaseReady
catalog := v1.NewCamelCatalog(platform.Namespace, defaults.DefaultRuntimeVersion)
- catalog.Spec = v1.CamelCatalogSpec{Runtime: v1.RuntimeSpec{Provider: platform.Status.Build.RuntimeProvider, Version: platform.Status.Build.RuntimeVersion}}
+ catalog.Spec = v1.CamelCatalogSpec{Runtime: v1.RuntimeSpec{Provider: platform.Status.Pipeline.RuntimeProvider, Version: platform.Status.Pipeline.RuntimeVersion}}
// mocked catalog versions
catalog.Spec.Runtime.Metadata = map[string]string{
"camel-quarkus.version": "2.16.0",
diff --git a/pkg/controller/build/build_controller.go b/pkg/controller/build/build_controller.go
index 13c8e1008..354f84043 100644
--- a/pkg/controller/build/build_controller.go
+++ b/pkg/controller/build/build_controller.go
@@ -143,10 +143,12 @@ func (r *reconcileBuild) Reconcile(ctx context.Context, request reconcile.Reques
var actions []Action
buildMonitor := Monitor{
- maxRunningBuilds: instance.Spec.MaxRunningBuilds,
+ // TODO enable this where we have the MaxRunningPipelines (the platform likely)
+ // maxRunningBuilds: instance.Spec.MaxRunningBuilds,
+ maxRunningBuilds: 10,
}
- switch instance.Spec.Configuration.Strategy {
+ switch instance.BuilderConfiguration().Strategy {
case v1.BuildStrategyPod:
actions = []Action{
newInitializePodAction(r.reader),
@@ -209,7 +211,7 @@ func (r *reconcileBuild) Reconcile(ctx context.Context, request reconcile.Reques
return reconcile.Result{RequeueAfter: 5 * time.Second}, nil
}
- if target.Spec.Configuration.Strategy == v1.BuildStrategyPod &&
+ if target.BuilderConfiguration().Strategy == v1.BuildStrategyPod &&
(target.Status.Phase == v1.BuildPhasePending || target.Status.Phase == v1.BuildPhaseRunning) {
// Requeue running Build to poll Pod and signal timeout
return reconcile.Result{RequeueAfter: 1 * time.Second}, nil
diff --git a/pkg/controller/build/build_monitor_test.go b/pkg/controller/build/build_monitor_test.go
index 51381b46d..f9755108f 100644
--- a/pkg/controller/build/build_monitor_test.go
+++ b/pkg/controller/build/build_monitor_test.go
@@ -227,15 +227,19 @@ func newBuildWithLayoutInPhase(namespace string, name string, layout string, pha
v1.IntegrationKitLayoutLabel: layout,
},
},
- Spec: v1.BuildSpec{
- Configuration: v1.BuildConfiguration{
- Strategy: v1.BuildStrategyRoutine,
+ Spec: v1.PipelineSpec{
+ Tasks: []v1.Task{
+ {
+ Builder: &v1.BuilderTask{
+ Configuration: v1.BuildConfiguration{
+ Strategy: v1.BuildStrategyRoutine,
+ ToolImage: "camel:latest",
+ BuilderPodNamespace: "ns",
+ },
+ },
+ },
},
- ToolImage: "camel:latest",
- BuilderPodNamespace: "ns",
- Tasks: []v1.Task{},
- Timeout: metav1.Duration{Duration: 5 * time.Minute},
- MaxRunningBuilds: 3,
+ Timeout: metav1.Duration{Duration: 5 * time.Minute},
},
Status: v1.BuildStatus{
Phase: phase,
diff --git a/pkg/controller/build/build_pod.go b/pkg/controller/build/build_pod.go
index 11f5d8e1b..cb738edb4 100644
--- a/pkg/controller/build/build_pod.go
+++ b/pkg/controller/build/build_pod.go
@@ -171,7 +171,7 @@ func newBuildPod(ctx context.Context, c ctrl.Reader, build *v1.Build) (*corev1.P
}
func configureResources(build *v1.Build, container *corev1.Container) {
- conf := build.Spec.Configuration
+ conf := *build.BuilderConfiguration()
requestsList := container.Resources.Requests
limitsList := container.Resources.Limits
var err error
@@ -272,7 +272,7 @@ func addBuildTaskToPod(build *v1.Build, taskName string, pod *corev1.Pod) {
container := corev1.Container{
Name: taskName,
- Image: build.Spec.ToolImage,
+ Image: build.BuilderConfiguration().ToolImage,
ImagePullPolicy: corev1.PullIfNotPresent,
Command: []string{
"kamel",
diff --git a/pkg/controller/catalog/initialize.go b/pkg/controller/catalog/initialize.go
index 98d4ddfbe..efe414461 100644
--- a/pkg/controller/catalog/initialize.go
+++ b/pkg/controller/catalog/initialize.go
@@ -67,7 +67,7 @@ func (action *initializeAction) Handle(ctx context.Context, catalog *v1.CamelCat
}
// Make basic options for building image in the registry
- options, err := makeSpectrumOptions(ctx, action.client, platform.Namespace, platform.Status.Build.Registry)
+ options, err := makeSpectrumOptions(ctx, action.client, platform.Namespace, platform.Status.Pipeline.Registry)
if err != nil {
return catalog, err
}
@@ -79,7 +79,7 @@ func initialize(options spectrum.Options, ip *v1.IntegrationPlatform, catalog *v
target := catalog.DeepCopy()
imageName := fmt.Sprintf(
"%s/camel-k-runtime-%s-builder:%s",
- ip.Status.Build.Registry.Address,
+ ip.Status.Pipeline.Registry.Address,
catalog.Spec.Runtime.Provider,
strings.ToLower(catalog.Spec.Runtime.Version),
)
@@ -116,7 +116,7 @@ func initialize(options spectrum.Options, ip *v1.IntegrationPlatform, catalog *v
options.Base = catalog.Spec.GetQuarkusToolingImage()
options.Target = imageName
- err := buildRuntimeBuilderWithTimeout(options, ip.Status.Build.GetBuildCatalogToolTimeout().Duration)
+ err := buildRuntimeBuilderWithTimeout(options, ip.Status.Pipeline.GetBuildCatalogToolTimeout().Duration)
if err != nil {
target.Status.Phase = v1.CamelCatalogPhaseError
diff --git a/pkg/controller/integrationkit/build.go b/pkg/controller/integrationkit/build.go
index ab7744ecd..4888337e1 100644
--- a/pkg/controller/integrationkit/build.go
+++ b/pkg/controller/integrationkit/build.go
@@ -99,8 +99,8 @@ func (action *buildAction) handleBuildSubmitted(ctx context.Context, kit *v1.Int
annotations[v1.OperatorIDAnnotation] = operatorID
}
- timeout := env.Platform.Status.Build.GetTimeout()
- if layout := labels[v1.IntegrationKitLayoutLabel]; env.Platform.Spec.Build.Timeout == nil && layout == v1.IntegrationKitLayoutNative {
+ timeout := env.Platform.Status.Pipeline.GetTimeout()
+ if layout := labels[v1.IntegrationKitLayoutLabel]; env.Platform.Spec.Pipeline.Timeout == nil && layout == v1.IntegrationKitLayoutNative {
// Increase the timeout to a sensible default
timeout = metav1.Duration{
Duration: 10 * time.Minute,
@@ -112,10 +112,10 @@ func (action *buildAction) handleBuildSubmitted(ctx context.Context, kit *v1.Int
buildConfig := env.BuildConfiguration
if buildConfig.IsEmpty() {
// default to IntegrationPlatform configuration
- buildConfig = env.Platform.Status.Build.BuildConfiguration
+ buildConfig = env.Platform.Status.Pipeline.BuildConfiguration
} else if buildConfig.Strategy == "" {
// we always need to define a strategy, so we default to platform if none
- buildConfig.Strategy = env.Platform.Status.Build.BuildConfiguration.Strategy
+ buildConfig.Strategy = env.Platform.Status.Pipeline.BuildConfiguration.Strategy
}
// nolint: contextcheck
@@ -133,6 +133,9 @@ func (action *buildAction) handleBuildSubmitted(ctx context.Context, kit *v1.Int
}
}
+ buildConfig.ToolImage = env.CamelCatalog.Image
+ buildConfig.BuilderPodNamespace = builderPodNamespace
+
build = &v1.Build{
TypeMeta: metav1.TypeMeta{
APIVersion: v1.SchemeGroupVersion.String(),
@@ -144,16 +147,14 @@ func (action *buildAction) handleBuildSubmitted(ctx context.Context, kit *v1.Int
Labels: labels,
Annotations: annotations,
},
- Spec: v1.BuildSpec{
- Configuration: buildConfig,
- ToolImage: env.CamelCatalog.Image,
- BuilderPodNamespace: builderPodNamespace,
- Tasks: env.BuildTasks,
- Timeout: timeout,
- MaxRunningBuilds: env.Platform.Status.Build.MaxRunningBuilds,
+ Spec: v1.PipelineSpec{
+ Tasks: env.Pipeline,
+ Timeout: timeout,
},
}
+ build.SetBuilderConfiguration(&buildConfig)
+
// Set the integration kit instance as the owner and controller
if err := controllerutil.SetControllerReference(kit, build, action.client.GetScheme()); err != nil {
return nil, err
diff --git a/pkg/controller/integrationplatform/initialize.go b/pkg/controller/integrationplatform/initialize.go
index a38274bdb..7a888762b 100644
--- a/pkg/controller/integrationplatform/initialize.go
+++ b/pkg/controller/integrationplatform/initialize.go
@@ -69,8 +69,8 @@ func (action *initializeAction) Handle(ctx context.Context, platform *v1.Integra
if err = platformutil.ConfigureDefaults(ctx, action.client, platform, true); err != nil {
return nil, err
}
- if platform.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyKaniko {
- cacheEnabled := platform.Status.Build.IsOptionEnabled(builder.KanikoBuildCacheEnabled)
+ if platform.Status.Pipeline.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyKaniko {
+ cacheEnabled := platform.Status.Pipeline.IsOptionEnabled(builder.KanikoBuildCacheEnabled)
if cacheEnabled {
// Create the persistent volume claim used by the Kaniko cache
action.L.Info("Create persistent volume claim")
@@ -121,7 +121,7 @@ func createPersistentVolumeClaim(ctx context.Context, client client.Client, plat
if err != nil {
return err
}
- pvcName := platform.Status.Build.PublishStrategyOptions[builder.KanikoPVCName]
+ pvcName := platform.Status.Pipeline.PublishStrategyOptions[builder.KanikoPVCName]
pvc := &corev1.PersistentVolumeClaim{
TypeMeta: metav1.TypeMeta{
APIVersion: corev1.SchemeGroupVersion.String(),
diff --git a/pkg/controller/integrationplatform/initialize_test.go b/pkg/controller/integrationplatform/initialize_test.go
index 158815b03..75b4ae720 100644
--- a/pkg/controller/integrationplatform/initialize_test.go
+++ b/pkg/controller/integrationplatform/initialize_test.go
@@ -53,7 +53,7 @@ func TestTimeouts_Default(t *testing.T) {
assert.Nil(t, err)
assert.NotNil(t, answer)
- assert.Equal(t, 5*time.Minute, answer.Status.Build.GetTimeout().Duration)
+ assert.Equal(t, 5*time.Minute, answer.Status.Pipeline.GetTimeout().Duration)
}
func TestTimeouts_MavenComputedFromBuild(t *testing.T) {
@@ -66,7 +66,7 @@ func TestTimeouts_MavenComputedFromBuild(t *testing.T) {
timeout, err := time.ParseDuration("1m1ms")
assert.Nil(t, err)
- ip.Spec.Build.Timeout = &metav1.Duration{
+ ip.Spec.Pipeline.Timeout = &metav1.Duration{
Duration: timeout,
}
@@ -83,7 +83,7 @@ func TestTimeouts_MavenComputedFromBuild(t *testing.T) {
assert.Nil(t, err)
assert.NotNil(t, answer)
- assert.Equal(t, 1*time.Minute, answer.Status.Build.GetTimeout().Duration)
+ assert.Equal(t, 1*time.Minute, answer.Status.Pipeline.GetTimeout().Duration)
}
func TestTimeouts_Truncated(t *testing.T) {
@@ -96,7 +96,7 @@ func TestTimeouts_Truncated(t *testing.T) {
bt, err := time.ParseDuration("5m1ms")
assert.Nil(t, err)
- ip.Spec.Build.Timeout = &metav1.Duration{
+ ip.Spec.Pipeline.Timeout = &metav1.Duration{
Duration: bt,
}
@@ -113,5 +113,5 @@ func TestTimeouts_Truncated(t *testing.T) {
assert.Nil(t, err)
assert.NotNil(t, answer)
- assert.Equal(t, 5*time.Minute, answer.Status.Build.GetTimeout().Duration)
+ assert.Equal(t, 5*time.Minute, answer.Status.Pipeline.GetTimeout().Duration)
}
diff --git a/pkg/controller/integrationplatform/kaniko_cache.go b/pkg/controller/integrationplatform/kaniko_cache.go
index f82ef1d52..c463a8725 100644
--- a/pkg/controller/integrationplatform/kaniko_cache.go
+++ b/pkg/controller/integrationplatform/kaniko_cache.go
@@ -38,10 +38,10 @@ func createKanikoCacheWarmerPod(ctx context.Context, client client.Client, platf
// See:
// - https://kubernetes.io/docs/concepts/storage/persistent-volumes/#node-affinity
// - https://kubernetes.io/docs/concepts/storage/volumes/#local
- pvcName := platform.Status.Build.PublishStrategyOptions[builder.KanikoPVCName]
+ pvcName := platform.Status.Pipeline.PublishStrategyOptions[builder.KanikoPVCName]
var warmerImage string
- if image, found := platform.Status.Build.PublishStrategyOptions[builder.KanikoWarmerImage]; found {
+ if image, found := platform.Status.Pipeline.PublishStrategyOptions[builder.KanikoWarmerImage]; found {
warmerImage = image
} else {
warmerImage = fmt.Sprintf("%s:v%s", builder.KanikoDefaultWarmerImageName, defaults.KanikoVersion)
@@ -66,7 +66,7 @@ func createKanikoCacheWarmerPod(ctx context.Context, client client.Client, platf
Image: warmerImage,
Args: []string{
"--cache-dir=" + builder.KanikoCacheDir,
- "--image=" + platform.Status.Build.BaseImage,
+ "--image=" + platform.Status.Pipeline.BaseImage,
},
VolumeMounts: []corev1.VolumeMount{
{
diff --git a/pkg/install/operator.go b/pkg/install/operator.go
index 54c2a1af5..807762257 100644
--- a/pkg/install/operator.go
+++ b/pkg/install/operator.go
@@ -643,7 +643,7 @@ func NewPlatform(
if !skipRegistrySetup {
// Let's apply registry settings whether it's OpenShift or not
// Some OpenShift variants such as Microshift might not have a built-in registry
- pl.Spec.Build.Registry = registry
+ pl.Spec.Pipeline.Registry = registry
if !isOpenShift && registry.Address == "" {
// This operation should be done here in the installer
@@ -664,11 +664,11 @@ func NewPlatform(
return nil, errors.New("cannot find a registry where to push images")
}
- pl.Spec.Build.Registry.Address = *address
- pl.Spec.Build.Registry.Insecure = true
- if pl.Spec.Build.PublishStrategy == "" {
+ pl.Spec.Pipeline.Registry.Address = *address
+ pl.Spec.Pipeline.Registry.Insecure = true
+ if pl.Spec.Pipeline.PublishStrategy == "" {
// Use spectrum in insecure dev clusters by default
- pl.Spec.Build.PublishStrategy = v1.IntegrationPlatformBuildPublishStrategySpectrum
+ pl.Spec.Pipeline.PublishStrategy = v1.IntegrationPlatformBuildPublishStrategySpectrum
}
}
}
diff --git a/pkg/platform/defaults.go b/pkg/platform/defaults.go
index f6d14829a..31ad980f8 100644
--- a/pkg/platform/defaults.go
+++ b/pkg/platform/defaults.go
@@ -72,18 +72,18 @@ func ConfigureDefaults(ctx context.Context, c client.Client, p *v1.IntegrationPl
}
}
- if p.Status.Build.PublishStrategy == "" {
+ if p.Status.Pipeline.PublishStrategy == "" {
if p.Status.Cluster == v1.IntegrationPlatformClusterOpenShift {
- p.Status.Build.PublishStrategy = v1.IntegrationPlatformBuildPublishStrategyS2I
+ p.Status.Pipeline.PublishStrategy = v1.IntegrationPlatformBuildPublishStrategyS2I
} else {
- p.Status.Build.PublishStrategy = v1.IntegrationPlatformBuildPublishStrategySpectrum
+ p.Status.Pipeline.PublishStrategy = v1.IntegrationPlatformBuildPublishStrategySpectrum
}
- log.Debugf("Integration Platform %s [%s]: setting publishing strategy %s", p.Name, p.Namespace, p.Status.Build.PublishStrategy)
+ log.Debugf("Integration Platform %s [%s]: setting publishing strategy %s", p.Name, p.Namespace, p.Status.Pipeline.PublishStrategy)
}
- if p.Status.Build.BuildConfiguration.Strategy == "" {
- p.Status.Build.BuildConfiguration.Strategy = v1.BuildStrategyPod
- log.Debugf("Integration Platform %s [%s]: setting build strategy %s", p.Name, p.Namespace, p.Status.Build.BuildConfiguration.Strategy)
+ if p.Status.Pipeline.BuildConfiguration.Strategy == "" {
+ p.Status.Pipeline.BuildConfiguration.Strategy = v1.BuildStrategyPod
+ log.Debugf("Integration Platform %s [%s]: setting build strategy %s", p.Name, p.Namespace, p.Status.Pipeline.BuildConfiguration.Strategy)
}
err := setPlatformDefaults(p, verbose)
@@ -91,7 +91,7 @@ func ConfigureDefaults(ctx context.Context, c client.Client, p *v1.IntegrationPl
return err
}
- if p.Status.Build.BuildConfiguration.Strategy == v1.BuildStrategyPod {
+ if p.Status.Pipeline.BuildConfiguration.Strategy == v1.BuildStrategyPod {
if err := CreateBuilderServiceAccount(ctx, c, p); err != nil {
return fmt.Errorf("cannot ensure service account is present: %w", err)
}
@@ -102,12 +102,12 @@ func ConfigureDefaults(ctx context.Context, c client.Client, p *v1.IntegrationPl
return err
}
- if verbose && p.Status.Build.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategyS2I && p.Status.Build.Registry.Address == "" {
+ if verbose && p.Status.Pipeline.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategyS2I && p.Status.Pipeline.Registry.Address == "" {
log.Log.Info("No registry specified for publishing images")
}
- if verbose && p.Status.Build.GetTimeout().Duration != 0 {
- log.Log.Infof("Maven Timeout set to %s", p.Status.Build.GetTimeout().Duration)
+ if verbose && p.Status.Pipeline.GetTimeout().Duration != 0 {
+ log.Log.Infof("Maven Timeout set to %s", p.Status.Pipeline.GetTimeout().Duration)
}
return nil
@@ -131,11 +131,11 @@ func CreateBuilderServiceAccount(ctx context.Context, client client.Client, p *v
func configureRegistry(ctx context.Context, c client.Client, p *v1.IntegrationPlatform, verbose bool) error {
if p.Status.Cluster == v1.IntegrationPlatformClusterOpenShift &&
- p.Status.Build.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategyS2I &&
- p.Status.Build.Registry.Address == "" {
+ p.Status.Pipeline.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategyS2I &&
+ p.Status.Pipeline.Registry.Address == "" {
log.Debugf("Integration Platform %s [%s]: setting registry address", p.Name, p.Namespace)
// Default to using OpenShift internal container images registry when using a strategy other than S2I
- p.Status.Build.Registry.Address = "image-registry.openshift-image-registry.svc:5000"
+ p.Status.Pipeline.Registry.Address = "image-registry.openshift-image-registry.svc:5000"
// OpenShift automatically injects the service CA certificate into the service-ca.crt key on the ConfigMap
cm, err := createServiceCaBundleConfigMap(ctx, c, p)
@@ -143,10 +143,10 @@ func configureRegistry(ctx context.Context, c client.Client, p *v1.IntegrationPl
return err
}
log.Debugf("Integration Platform %s [%s]: setting registry certificate authority", p.Name, p.Namespace)
- p.Status.Build.Registry.CA = cm.Name
+ p.Status.Pipeline.Registry.CA = cm.Name
// Default to using the registry secret that's configured for the builder service account
- if p.Status.Build.Registry.Secret == "" {
+ if p.Status.Pipeline.Registry.Secret == "" {
log.Debugf("Integration Platform %s [%s]: setting registry secret", p.Name, p.Namespace)
// Bind the required role to push images to the registry
err := createBuilderRegistryRoleBinding(ctx, c, p)
@@ -162,24 +162,24 @@ func configureRegistry(ctx context.Context, c client.Client, p *v1.IntegrationPl
// We may want to read the secret keys instead of relying on the secret name scheme
for _, secret := range sa.Secrets {
if strings.Contains(secret.Name, "camel-k-builder-dockercfg") {
- p.Status.Build.Registry.Secret = secret.Name
+ p.Status.Pipeline.Registry.Secret = secret.Name
break
}
}
}
}
- if p.Status.Build.Registry.Address == "" {
+ if p.Status.Pipeline.Registry.Address == "" {
// try KEP-1755
address, err := image.GetRegistryAddress(ctx, c)
if err != nil && verbose {
log.Error(err, "Cannot find a registry where to push images via KEP-1755")
} else if err == nil && address != nil {
- p.Status.Build.Registry.Address = *address
+ p.Status.Pipeline.Registry.Address = *address
}
}
- log.Debugf("Final Registry Address: %s", p.Status.Build.Registry.Address)
+ log.Debugf("Final Registry Address: %s", p.Status.Pipeline.Registry.Address)
return nil
}
@@ -215,60 +215,60 @@ func applyPlatformSpec(source *v1.IntegrationPlatform, target *v1.IntegrationPla
target.Status.Profile = source.Status.Profile
}
- if target.Status.Build.PublishStrategy == "" {
- target.Status.Build.PublishStrategy = source.Status.Build.PublishStrategy
+ if target.Status.Pipeline.PublishStrategy == "" {
+ target.Status.Pipeline.PublishStrategy = source.Status.Pipeline.PublishStrategy
}
- if target.Status.Build.PublishStrategyOptions == nil {
+ if target.Status.Pipeline.PublishStrategyOptions == nil {
log.Debugf("Integration Platform %s [%s]: setting publish strategy options", target.Name, target.Namespace)
- target.Status.Build.PublishStrategyOptions = source.Status.Build.PublishStrategyOptions
+ target.Status.Pipeline.PublishStrategyOptions = source.Status.Pipeline.PublishStrategyOptions
}
- if target.Status.Build.BuildConfiguration.Strategy == "" {
- target.Status.Build.BuildConfiguration.Strategy = source.Status.Build.BuildConfiguration.Strategy
+ if target.Status.Pipeline.BuildConfiguration.Strategy == "" {
+ target.Status.Pipeline.BuildConfiguration.Strategy = source.Status.Pipeline.BuildConfiguration.Strategy
}
- if target.Status.Build.RuntimeVersion == "" {
+ if target.Status.Pipeline.RuntimeVersion == "" {
log.Debugf("Integration Platform %s [%s]: setting runtime version", target.Name, target.Namespace)
- target.Status.Build.RuntimeVersion = source.Status.Build.RuntimeVersion
+ target.Status.Pipeline.RuntimeVersion = source.Status.Pipeline.RuntimeVersion
}
- if target.Status.Build.BaseImage == "" {
+ if target.Status.Pipeline.BaseImage == "" {
log.Debugf("Integration Platform %s [%s]: setting base image", target.Name, target.Namespace)
- target.Status.Build.BaseImage = source.Status.Build.BaseImage
+ target.Status.Pipeline.BaseImage = source.Status.Pipeline.BaseImage
}
- if target.Status.Build.Maven.LocalRepository == "" {
+ if target.Status.Pipeline.Maven.LocalRepository == "" {
log.Debugf("Integration Platform %s [%s]: setting local repository", target.Name, target.Namespace)
- target.Status.Build.Maven.LocalRepository = source.Status.Build.Maven.LocalRepository
+ target.Status.Pipeline.Maven.LocalRepository = source.Status.Pipeline.Maven.LocalRepository
}
- if len(source.Status.Build.Maven.CLIOptions) > 0 && len(target.Status.Build.Maven.CLIOptions) == 0 {
+ if len(source.Status.Pipeline.Maven.CLIOptions) > 0 && len(target.Status.Pipeline.Maven.CLIOptions) == 0 {
log.Debugf("Integration Platform %s [%s]: setting CLI options", target.Name, target.Namespace)
- target.Status.Build.Maven.CLIOptions = make([]string, len(source.Status.Build.Maven.CLIOptions))
- copy(target.Status.Build.Maven.CLIOptions, source.Status.Build.Maven.CLIOptions)
+ target.Status.Pipeline.Maven.CLIOptions = make([]string, len(source.Status.Pipeline.Maven.CLIOptions))
+ copy(target.Status.Pipeline.Maven.CLIOptions, source.Status.Pipeline.Maven.CLIOptions)
}
- if len(source.Status.Build.Maven.Properties) > 0 {
+ if len(source.Status.Pipeline.Maven.Properties) > 0 {
log.Debugf("Integration Platform %s [%s]: setting Maven properties", target.Name, target.Namespace)
- if len(target.Status.Build.Maven.Properties) == 0 {
- target.Status.Build.Maven.Properties = make(map[string]string, len(source.Status.Build.Maven.Properties))
+ if len(target.Status.Pipeline.Maven.Properties) == 0 {
+ target.Status.Pipeline.Maven.Properties = make(map[string]string, len(source.Status.Pipeline.Maven.Properties))
}
- for key, val := range source.Status.Build.Maven.Properties {
+ for key, val := range source.Status.Pipeline.Maven.Properties {
// only set unknown properties on target
- if _, ok := target.Status.Build.Maven.Properties[key]; !ok {
- target.Status.Build.Maven.Properties[key] = val
+ if _, ok := target.Status.Pipeline.Maven.Properties[key]; !ok {
+ target.Status.Pipeline.Maven.Properties[key] = val
}
}
}
- if len(source.Status.Build.Maven.Extension) > 0 && len(target.Status.Build.Maven.Extension) == 0 {
+ if len(source.Status.Pipeline.Maven.Extension) > 0 && len(target.Status.Pipeline.Maven.Extension) == 0 {
log.Debugf("Integration Platform %s [%s]: setting Maven extensions", target.Name, target.Namespace)
- target.Status.Build.Maven.Extension = make([]v1.MavenArtifact, len(source.Status.Build.Maven.Extension))
- copy(target.Status.Build.Maven.Extension, source.Status.Build.Maven.Extension)
+ target.Status.Pipeline.Maven.Extension = make([]v1.MavenArtifact, len(source.Status.Pipeline.Maven.Extension))
+ copy(target.Status.Pipeline.Maven.Extension, source.Status.Pipeline.Maven.Extension)
}
- if target.Status.Build.Registry.Address == "" && source.Status.Build.Registry.Address != "" {
+ if target.Status.Pipeline.Registry.Address == "" && source.Status.Pipeline.Registry.Address != "" {
log.Debugf("Integration Platform %s [%s]: setting registry", target.Name, target.Namespace)
- source.Status.Build.Registry.DeepCopyInto(&target.Status.Build.Registry)
+ source.Status.Pipeline.Registry.DeepCopyInto(&target.Status.Pipeline.Registry)
}
if err := target.Status.Traits.Merge(source.Status.Traits); err != nil {
@@ -278,20 +278,15 @@ func applyPlatformSpec(source *v1.IntegrationPlatform, target *v1.IntegrationPla
}
// Build timeout
- if target.Status.Build.Timeout == nil {
+ if target.Status.Pipeline.Timeout == nil {
log.Debugf("Integration Platform %s [%s]: setting build timeout", target.Name, target.Namespace)
- target.Status.Build.Timeout = source.Status.Build.Timeout
+ target.Status.Pipeline.Timeout = source.Status.Pipeline.Timeout
}
// Catalog tools build timeout
- if target.Status.Build.BuildCatalogToolTimeout == nil {
+ if target.Status.Pipeline.BuildCatalogToolTimeout == nil {
log.Debugf("Integration Platform %s [%s]: setting build camel catalog tool timeout", target.Name, target.Namespace)
- target.Status.Build.BuildCatalogToolTimeout = source.Status.Build.BuildCatalogToolTimeout
- }
-
- if target.Status.Build.MaxRunningBuilds <= 0 {
- log.Debugf("Integration Platform %s [%s]: setting max running builds", target.Name, target.Namespace)
- target.Status.Build.MaxRunningBuilds = source.Status.Build.MaxRunningBuilds
+ target.Status.Pipeline.BuildCatalogToolTimeout = source.Status.Pipeline.BuildCatalogToolTimeout
}
if len(target.Status.Kamelet.Repositories) == 0 {
@@ -301,88 +296,88 @@ func applyPlatformSpec(source *v1.IntegrationPlatform, target *v1.IntegrationPla
}
func setPlatformDefaults(p *v1.IntegrationPlatform, verbose bool) error {
- if p.Status.Build.PublishStrategyOptions == nil {
+ if p.Status.Pipeline.PublishStrategyOptions == nil {
log.Debugf("Integration Platform %s [%s]: setting publish strategy options", p.Name, p.Namespace)
- p.Status.Build.PublishStrategyOptions = map[string]string{}
+ p.Status.Pipeline.PublishStrategyOptions = map[string]string{}
}
- if p.Status.Build.RuntimeVersion == "" {
+ if p.Status.Pipeline.RuntimeVersion == "" {
log.Debugf("Integration Platform %s [%s]: setting runtime version", p.Name, p.Namespace)
- p.Status.Build.RuntimeVersion = defaults.DefaultRuntimeVersion
+ p.Status.Pipeline.RuntimeVersion = defaults.DefaultRuntimeVersion
}
- if p.Status.Build.BaseImage == "" {
+ if p.Status.Pipeline.BaseImage == "" {
log.Debugf("Integration Platform %s [%s]: setting base image", p.Name, p.Namespace)
- p.Status.Build.BaseImage = defaults.BaseImage()
+ p.Status.Pipeline.BaseImage = defaults.BaseImage()
}
- if p.Status.Build.Maven.LocalRepository == "" {
+ if p.Status.Pipeline.Maven.LocalRepository == "" {
log.Debugf("Integration Platform %s [%s]: setting local repository", p.Name, p.Namespace)
- p.Status.Build.Maven.LocalRepository = defaults.LocalRepository
+ p.Status.Pipeline.Maven.LocalRepository = defaults.LocalRepository
}
- if len(p.Status.Build.Maven.CLIOptions) == 0 {
+ if len(p.Status.Pipeline.Maven.CLIOptions) == 0 {
log.Debugf("Integration Platform %s [%s]: setting CLI options", p.Name, p.Namespace)
- p.Status.Build.Maven.CLIOptions = []string{
+ p.Status.Pipeline.Maven.CLIOptions = []string{
"-V",
"--no-transfer-progress",
"-Dstyle.color=never",
}
}
- if _, ok := p.Status.Build.PublishStrategyOptions[builder.KanikoPVCName]; !ok {
+ if _, ok := p.Status.Pipeline.PublishStrategyOptions[builder.KanikoPVCName]; !ok {
log.Debugf("Integration Platform %s [%s]: setting publish strategy options", p.Name, p.Namespace)
- p.Status.Build.PublishStrategyOptions[builder.KanikoPVCName] = p.Name
+ p.Status.Pipeline.PublishStrategyOptions[builder.KanikoPVCName] = p.Name
}
// Build timeout
- if p.Status.Build.GetTimeout().Duration == 0 {
- p.Status.Build.Timeout = &metav1.Duration{
+ if p.Status.Pipeline.GetTimeout().Duration == 0 {
+ p.Status.Pipeline.Timeout = &metav1.Duration{
Duration: 5 * time.Minute,
}
} else {
- d := p.Status.Build.GetTimeout().Duration.Truncate(time.Second)
+ d := p.Status.Pipeline.GetTimeout().Duration.Truncate(time.Second)
- if verbose && p.Status.Build.GetTimeout().Duration != d {
- log.Log.Infof("Build timeout minimum unit is sec (configured: %s, truncated: %s)", p.Status.Build.GetTimeout().Duration, d)
+ if verbose && p.Status.Pipeline.GetTimeout().Duration != d {
+ log.Log.Infof("Build timeout minimum unit is sec (configured: %s, truncated: %s)", p.Status.Pipeline.GetTimeout().Duration, d)
}
log.Debugf("Integration Platform %s [%s]: setting build timeout", p.Name, p.Namespace)
- p.Status.Build.Timeout = &metav1.Duration{
+ p.Status.Pipeline.Timeout = &metav1.Duration{
Duration: d,
}
}
// Catalog tools build timeout
- if p.Status.Build.GetBuildCatalogToolTimeout().Duration == 0 {
+ if p.Status.Pipeline.GetBuildCatalogToolTimeout().Duration == 0 {
log.Debugf("Integration Platform %s [%s]: setting default build camel catalog tool timeout (1 minute)", p.Name, p.Namespace)
- p.Status.Build.BuildCatalogToolTimeout = &metav1.Duration{
+ p.Status.Pipeline.BuildCatalogToolTimeout = &metav1.Duration{
Duration: 1 * time.Minute,
}
} else {
- d := p.Status.Build.GetBuildCatalogToolTimeout().Duration.Truncate(time.Second)
+ d := p.Status.Pipeline.GetBuildCatalogToolTimeout().Duration.Truncate(time.Second)
- if verbose && p.Status.Build.GetBuildCatalogToolTimeout().Duration != d {
- log.Log.Infof("Build catalog tools timeout minimum unit is sec (configured: %s, truncated: %s)", p.Status.Build.GetBuildCatalogToolTimeout().Duration, d)
+ if verbose && p.Status.Pipeline.GetBuildCatalogToolTimeout().Duration != d {
+ log.Log.Infof("Build catalog tools timeout minimum unit is sec (configured: %s, truncated: %s)", p.Status.Pipeline.GetBuildCatalogToolTimeout().Duration, d)
}
log.Debugf("Integration Platform %s [%s]: setting build catalog tools timeout", p.Name, p.Namespace)
- p.Status.Build.BuildCatalogToolTimeout = &metav1.Duration{
+ p.Status.Pipeline.BuildCatalogToolTimeout = &metav1.Duration{
Duration: d,
}
}
- if p.Status.Build.MaxRunningBuilds <= 0 {
+ if p.Status.Pipeline.MaxRunningPipelines <= 0 {
log.Debugf("Integration Platform %s [%s]: setting max running builds", p.Name, p.Namespace)
- if p.Status.Build.BuildConfiguration.Strategy == v1.BuildStrategyRoutine {
- p.Status.Build.MaxRunningBuilds = 3
- } else if p.Status.Build.BuildConfiguration.Strategy == v1.BuildStrategyPod {
- p.Status.Build.MaxRunningBuilds = 10
+ if p.Status.Pipeline.BuildConfiguration.Strategy == v1.BuildStrategyRoutine {
+ p.Status.Pipeline.MaxRunningPipelines = 3
+ } else if p.Status.Pipeline.BuildConfiguration.Strategy == v1.BuildStrategyPod {
+ p.Status.Pipeline.MaxRunningPipelines = 10
}
}
- _, cacheEnabled := p.Status.Build.PublishStrategyOptions[builder.KanikoBuildCacheEnabled]
- if p.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyKaniko && !cacheEnabled {
+ _, cacheEnabled := p.Status.Pipeline.PublishStrategyOptions[builder.KanikoBuildCacheEnabled]
+ if p.Status.Pipeline.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyKaniko && !cacheEnabled {
// Default to disabling Kaniko cache warmer
// Using the cache warmer pod seems unreliable with the current Kaniko version
// and requires relying on a persistent volume.
defaultKanikoBuildCache := "false"
- p.Status.Build.PublishStrategyOptions[builder.KanikoBuildCacheEnabled] = defaultKanikoBuildCache
+ p.Status.Pipeline.PublishStrategyOptions[builder.KanikoBuildCacheEnabled] = defaultKanikoBuildCache
if verbose {
log.Log.Infof("Kaniko cache set to %s", defaultKanikoBuildCache)
}
@@ -397,10 +392,10 @@ func setPlatformDefaults(p *v1.IntegrationPlatform, verbose bool) error {
setStatusAdditionalInfo(p)
if verbose {
- log.Log.Infof("RuntimeVersion set to %s", p.Status.Build.RuntimeVersion)
- log.Log.Infof("BaseImage set to %s", p.Status.Build.BaseImage)
- log.Log.Infof("LocalRepository set to %s", p.Status.Build.Maven.LocalRepository)
- log.Log.Infof("Timeout set to %s", p.Status.Build.GetTimeout())
+ log.Log.Infof("RuntimeVersion set to %s", p.Status.Pipeline.RuntimeVersion)
+ log.Log.Infof("BaseImage set to %s", p.Status.Pipeline.BaseImage)
+ log.Log.Infof("LocalRepository set to %s", p.Status.Pipeline.Maven.LocalRepository)
+ log.Log.Infof("Timeout set to %s", p.Status.Pipeline.GetTimeout())
}
return nil
@@ -410,9 +405,9 @@ func setStatusAdditionalInfo(platform *v1.IntegrationPlatform) {
platform.Status.Info = make(map[string]string)
log.Debugf("Integration Platform %s [%s]: setting build publish strategy", platform.Name, platform.Namespace)
- if platform.Spec.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyBuildah {
+ if platform.Spec.Pipeline.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyBuildah {
platform.Status.Info["buildahVersion"] = defaults.BuildahVersion
- } else if platform.Spec.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyKaniko {
+ } else if platform.Spec.Pipeline.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyKaniko {
platform.Status.Info["kanikoVersion"] = defaults.KanikoVersion
}
log.Debugf("Integration Platform %s [%s]: setting status info", platform.Name, platform.Namespace)
diff --git a/pkg/platform/defaults_test.go b/pkg/platform/defaults_test.go
index 8b64acea5..b91a4c574 100644
--- a/pkg/platform/defaults_test.go
+++ b/pkg/platform/defaults_test.go
@@ -37,7 +37,7 @@ func TestApplyGlobalPlatformSpec(t *testing.T) {
Namespace: "ns",
},
Spec: v1.IntegrationPlatformSpec{
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
BuildConfiguration: v1.BuildConfiguration{
Strategy: v1.BuildStrategyRoutine,
},
@@ -81,12 +81,12 @@ func TestApplyGlobalPlatformSpec(t *testing.T) {
assert.Equal(t, v1.IntegrationPlatformClusterOpenShift, ip.Status.Cluster)
assert.Equal(t, v1.TraitProfileOpenShift, ip.Status.Profile)
- assert.Equal(t, v1.BuildStrategyRoutine, ip.Status.Build.BuildConfiguration.Strategy)
+ assert.Equal(t, v1.BuildStrategyRoutine, ip.Status.Pipeline.BuildConfiguration.Strategy)
- assert.True(t, ip.Status.Build.MaxRunningBuilds == 3) // default for build strategy routine
+ // TODO assert.True(t, ip.Status.Pipeline.MaxRunningPipelines == 3) // default for build strategy routine
- assert.Equal(t, len(global.Status.Build.Maven.CLIOptions), len(ip.Status.Build.Maven.CLIOptions))
- assert.Equal(t, global.Status.Build.Maven.CLIOptions, ip.Status.Build.Maven.CLIOptions)
+ assert.Equal(t, len(global.Status.Pipeline.Maven.CLIOptions), len(ip.Status.Pipeline.Maven.CLIOptions))
+ assert.Equal(t, global.Status.Pipeline.Maven.CLIOptions, ip.Status.Pipeline.Maven.CLIOptions)
assert.NotNil(t, ip.Status.Traits)
assert.NotNil(t, ip.Status.Traits.Logging)
@@ -95,9 +95,9 @@ func TestApplyGlobalPlatformSpec(t *testing.T) {
assert.Equal(t, corev1.PullAlways, ip.Status.Traits.Container.ImagePullPolicy)
assert.Equal(t, "0.1", ip.Status.Traits.Container.LimitCPU)
- assert.Equal(t, 2, len(ip.Status.Build.Maven.Properties))
- assert.Equal(t, "global_value1", ip.Status.Build.Maven.Properties["global_prop1"])
- assert.Equal(t, "global_value2", ip.Status.Build.Maven.Properties["global_prop2"])
+ assert.Equal(t, 2, len(ip.Status.Pipeline.Maven.Properties))
+ assert.Equal(t, "global_value1", ip.Status.Pipeline.Maven.Properties["global_prop1"])
+ assert.Equal(t, "global_value2", ip.Status.Pipeline.Maven.Properties["global_prop2"])
}
func TestRetainLocalPlatformSpec(t *testing.T) {
@@ -107,7 +107,7 @@ func TestRetainLocalPlatformSpec(t *testing.T) {
Namespace: "ns",
},
Spec: v1.IntegrationPlatformSpec{
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
BuildConfiguration: v1.BuildConfiguration{
Strategy: v1.BuildStrategyRoutine,
},
@@ -144,11 +144,10 @@ func TestRetainLocalPlatformSpec(t *testing.T) {
Namespace: "ns",
},
Spec: v1.IntegrationPlatformSpec{
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
BuildConfiguration: v1.BuildConfiguration{
Strategy: v1.BuildStrategyPod,
},
- MaxRunningBuilds: 1,
Maven: v1.MavenSpec{
Properties: map[string]string{
"local_prop1": "local_value1",
@@ -172,12 +171,12 @@ func TestRetainLocalPlatformSpec(t *testing.T) {
assert.Equal(t, v1.IntegrationPlatformClusterKubernetes, ip.Status.Cluster)
assert.Equal(t, v1.TraitProfileKnative, ip.Status.Profile)
- assert.Equal(t, v1.BuildStrategyPod, ip.Status.Build.BuildConfiguration.Strategy)
+ assert.Equal(t, v1.BuildStrategyPod, ip.Status.Pipeline.BuildConfiguration.Strategy)
- assert.True(t, ip.Status.Build.MaxRunningBuilds == 1)
+ // TODO assert.True(t, ip.Status.Pipeline.MaxRunningPipelines == 1)
- assert.Equal(t, len(global.Status.Build.Maven.CLIOptions), len(ip.Status.Build.Maven.CLIOptions))
- assert.Equal(t, global.Status.Build.Maven.CLIOptions, ip.Status.Build.Maven.CLIOptions)
+ assert.Equal(t, len(global.Status.Pipeline.Maven.CLIOptions), len(ip.Status.Pipeline.Maven.CLIOptions))
+ assert.Equal(t, global.Status.Pipeline.Maven.CLIOptions, ip.Status.Pipeline.Maven.CLIOptions)
assert.NotNil(t, ip.Status.Traits)
assert.NotNil(t, ip.Status.Traits.Logging)
@@ -186,8 +185,8 @@ func TestRetainLocalPlatformSpec(t *testing.T) {
assert.Equal(t, corev1.PullAlways, ip.Status.Traits.Container.ImagePullPolicy)
assert.Equal(t, "0.1", ip.Status.Traits.Container.LimitCPU)
- assert.Equal(t, 3, len(ip.Status.Build.Maven.Properties))
- assert.Equal(t, "global_value1", ip.Status.Build.Maven.Properties["global_prop1"])
- assert.Equal(t, "local_value2", ip.Status.Build.Maven.Properties["global_prop2"])
- assert.Equal(t, "local_value1", ip.Status.Build.Maven.Properties["local_prop1"])
+ assert.Equal(t, 3, len(ip.Status.Pipeline.Maven.Properties))
+ assert.Equal(t, "global_value1", ip.Status.Pipeline.Maven.Properties["global_prop1"])
+ assert.Equal(t, "local_value2", ip.Status.Pipeline.Maven.Properties["global_prop2"])
+ assert.Equal(t, "local_value1", ip.Status.Pipeline.Maven.Properties["local_prop1"])
}
diff --git a/pkg/trait/builder.go b/pkg/trait/builder.go
index ba30eb727..a3dda1e1e 100644
--- a/pkg/trait/builder.go
+++ b/pkg/trait/builder.go
@@ -72,23 +72,23 @@ func (t *builderTrait) Apply(e *Environment) error {
return nil
}
- e.BuildTasks = append(e.BuildTasks, v1.Task{Builder: builderTask})
+ e.Pipeline = append(e.Pipeline, v1.Task{Builder: builderTask})
- switch e.Platform.Status.Build.PublishStrategy {
+ switch e.Platform.Status.Pipeline.PublishStrategy {
case v1.IntegrationPlatformBuildPublishStrategySpectrum:
- e.BuildTasks = append(e.BuildTasks, v1.Task{Spectrum: &v1.SpectrumTask{
+ e.Pipeline = append(e.Pipeline, v1.Task{Spectrum: &v1.SpectrumTask{
BaseTask: v1.BaseTask{
Name: "spectrum",
},
PublishTask: v1.PublishTask{
- BaseImage: e.Platform.Status.Build.BaseImage,
+ BaseImage: e.Platform.Status.Pipeline.BaseImage,
Image: getImageName(e),
- Registry: e.Platform.Status.Build.Registry,
+ Registry: e.Platform.Status.Pipeline.Registry,
},
}})
case v1.IntegrationPlatformBuildPublishStrategyS2I:
- e.BuildTasks = append(e.BuildTasks, v1.Task{S2i: &v1.S2iTask{
+ e.Pipeline = append(e.Pipeline, v1.Task{S2i: &v1.S2iTask{
BaseTask: v1.BaseTask{
Name: "s2i",
},
@@ -98,47 +98,47 @@ func (t *builderTrait) Apply(e *Environment) error {
case v1.IntegrationPlatformBuildPublishStrategyBuildah:
var platform string
var found bool
- if platform, found = e.Platform.Status.Build.PublishStrategyOptions[builder.BuildahPlatform]; !found {
+ if platform, found = e.Platform.Status.Pipeline.PublishStrategyOptions[builder.BuildahPlatform]; !found {
platform = ""
t.L.Infof("Attribute platform for buildah not found, default from host will be used!")
} else {
t.L.Infof("User defined %s platform, will be used from buildah!", platform)
}
var executorImage string
- if image, found := e.Platform.Status.Build.PublishStrategyOptions[builder.BuildahImage]; found {
+ if image, found := e.Platform.Status.Pipeline.PublishStrategyOptions[builder.BuildahImage]; found {
executorImage = image
t.L.Infof("User defined executor image %s will be used for buildah", image)
}
- e.BuildTasks = append(e.BuildTasks, v1.Task{Buildah: &v1.BuildahTask{
+ e.Pipeline = append(e.Pipeline, v1.Task{Buildah: &v1.BuildahTask{
Platform: platform,
BaseTask: v1.BaseTask{
Name: "buildah",
},
PublishTask: v1.PublishTask{
Image: getImageName(e),
- Registry: e.Platform.Status.Build.Registry,
+ Registry: e.Platform.Status.Pipeline.Registry,
},
Verbose: t.Verbose,
ExecutorImage: executorImage,
}})
//nolint: staticcheck,nolintlint
case v1.IntegrationPlatformBuildPublishStrategyKaniko:
- persistentVolumeClaim := e.Platform.Status.Build.PublishStrategyOptions[builder.KanikoPVCName]
- cacheEnabled := e.Platform.Status.Build.IsOptionEnabled(builder.KanikoBuildCacheEnabled)
+ persistentVolumeClaim := e.Platform.Status.Pipeline.PublishStrategyOptions[builder.KanikoPVCName]
+ cacheEnabled := e.Platform.Status.Pipeline.IsOptionEnabled(builder.KanikoBuildCacheEnabled)
var executorImage string
- if image, found := e.Platform.Status.Build.PublishStrategyOptions[builder.KanikoExecutorImage]; found {
+ if image, found := e.Platform.Status.Pipeline.PublishStrategyOptions[builder.KanikoExecutorImage]; found {
executorImage = image
t.L.Infof("User defined executor image %s will be used for kaniko", image)
}
- e.BuildTasks = append(e.BuildTasks, v1.Task{Kaniko: &v1.KanikoTask{
+ e.Pipeline = append(e.Pipeline, v1.Task{Kaniko: &v1.KanikoTask{
BaseTask: v1.BaseTask{
Name: "kaniko",
},
PublishTask: v1.PublishTask{
Image: getImageName(e),
- Registry: e.Platform.Status.Build.Registry,
+ Registry: e.Platform.Status.Pipeline.Registry,
},
Cache: v1.KanikoTaskCache{
Enabled: &cacheEnabled,
@@ -179,7 +179,7 @@ func (t *builderTrait) Apply(e *Environment) error {
func (t *builderTrait) builderTask(e *Environment) (*v1.BuilderTask, error) {
maven := v1.MavenBuildSpec{
- MavenSpec: e.Platform.Status.Build.Maven,
+ MavenSpec: e.Platform.Status.Pipeline.Maven,
}
// Add Maven repositories defined in the IntegrationKit
for _, repo := range e.IntegrationKit.Spec.Repositories {
@@ -190,7 +190,7 @@ func (t *builderTrait) builderTask(e *Environment) (*v1.BuilderTask, error) {
BaseTask: v1.BaseTask{
Name: "builder",
},
- BaseImage: e.Platform.Status.Build.BaseImage,
+ BaseImage: e.Platform.Status.Pipeline.BaseImage,
Runtime: e.CamelCatalog.Runtime,
Dependencies: e.IntegrationKit.Spec.Dependencies,
Maven: maven,
@@ -225,9 +225,9 @@ func (t *builderTrait) builderTask(e *Environment) (*v1.BuilderTask, error) {
}
func getImageName(e *Environment) string {
- organization := e.Platform.Status.Build.Registry.Organization
+ organization := e.Platform.Status.Pipeline.Registry.Organization
if organization == "" {
organization = e.Platform.Namespace
}
- return e.Platform.Status.Build.Registry.Address + "/" + organization + "/camel-k-" + e.IntegrationKit.Name + ":" + e.IntegrationKit.ResourceVersion
+ return e.Platform.Status.Pipeline.Registry.Address + "/" + organization + "/camel-k-" + e.IntegrationKit.Name + ":" + e.IntegrationKit.ResourceVersion
}
diff --git a/pkg/trait/builder_test.go b/pkg/trait/builder_test.go
index c40b32534..caad574aa 100644
--- a/pkg/trait/builder_test.go
+++ b/pkg/trait/builder_test.go
@@ -50,7 +50,7 @@ func TestBuilderTraitNotAppliedBecauseOfNilKit(t *testing.T) {
assert.Nil(t, err)
assert.NotEmpty(t, e.ExecutedTraits)
assert.Nil(t, e.GetTrait("builder"))
- assert.Empty(t, e.BuildTasks)
+ assert.Empty(t, e.Pipeline)
})
}
}
@@ -71,7 +71,7 @@ func TestBuilderTraitNotAppliedBecauseOfNilPhase(t *testing.T) {
assert.Nil(t, err)
assert.NotEmpty(t, e.ExecutedTraits)
assert.Nil(t, e.GetTrait("builder"))
- assert.Empty(t, e.BuildTasks)
+ assert.Empty(t, e.Pipeline)
})
}
}
@@ -83,10 +83,10 @@ func TestS2IBuilderTrait(t *testing.T) {
assert.Nil(t, err)
assert.NotEmpty(t, env.ExecutedTraits)
assert.NotNil(t, env.GetTrait("builder"))
- assert.NotEmpty(t, env.BuildTasks)
- assert.Len(t, env.BuildTasks, 2)
- assert.NotNil(t, env.BuildTasks[0].Builder)
- assert.NotNil(t, env.BuildTasks[1].S2i)
+ assert.NotEmpty(t, env.Pipeline)
+ assert.Len(t, env.Pipeline, 2)
+ assert.NotNil(t, env.Pipeline[0].Builder)
+ assert.NotNil(t, env.Pipeline[1].S2i)
}
func TestKanikoBuilderTrait(t *testing.T) {
@@ -96,10 +96,10 @@ func TestKanikoBuilderTrait(t *testing.T) {
assert.Nil(t, err)
assert.NotEmpty(t, env.ExecutedTraits)
assert.NotNil(t, env.GetTrait("builder"))
- assert.NotEmpty(t, env.BuildTasks)
- assert.Len(t, env.BuildTasks, 2)
- assert.NotNil(t, env.BuildTasks[0].Builder)
- assert.NotNil(t, env.BuildTasks[1].Kaniko)
+ assert.NotEmpty(t, env.Pipeline)
+ assert.Len(t, env.Pipeline, 2)
+ assert.NotNil(t, env.Pipeline[0].Builder)
+ assert.NotNil(t, env.Pipeline[1].Kaniko)
}
func createBuilderTestEnv(cluster v1.IntegrationPlatformCluster, strategy v1.IntegrationPlatformBuildPublishStrategy) *Environment {
@@ -130,7 +130,7 @@ func createBuilderTestEnv(cluster v1.IntegrationPlatformCluster, strategy v1.Int
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: cluster,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: strategy,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: defaults.DefaultRuntimeVersion,
@@ -164,7 +164,7 @@ func TestMavenPropertyBuilderTrait(t *testing.T) {
err := builderTrait.Apply(env)
assert.Nil(t, err)
- assert.Equal(t, "build-time-value1", env.BuildTasks[0].Builder.Maven.Properties["build-time-prop1"])
+ assert.Equal(t, "build-time-value1", env.Pipeline[0].Builder.Maven.Properties["build-time-prop1"])
}
func createNominalBuilderTraitTest() *builderTrait {
diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index 8974b7879..49c43ede1 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -122,10 +122,10 @@ func (t *camelTrait) loadOrCreateCatalog(e *Environment, runtimeVersion string)
// the required versions (camel and runtime) are not expressed as
// semver constraints
if exactVersionRegexp.MatchString(runtimeVersion) {
- ctx, cancel := context.WithTimeout(e.Ctx, e.Platform.Status.Build.GetTimeout().Duration)
+ ctx, cancel := context.WithTimeout(e.Ctx, e.Platform.Status.Pipeline.GetTimeout().Duration)
defer cancel()
catalog, err = camel.GenerateCatalog(ctx, e.Client,
- ns, e.Platform.Status.Build.Maven, runtime, []maven.Dependency{})
+ ns, e.Platform.Status.Pipeline.Maven, runtime, []maven.Dependency{})
if err != nil {
return err
}
@@ -257,8 +257,8 @@ func determineRuntimeVersion(e *Environment) string {
if e.IntegrationKit != nil && e.IntegrationKit.Status.RuntimeVersion != "" {
return e.IntegrationKit.Status.RuntimeVersion
}
- if e.Platform != nil && e.Platform.Status.Build.RuntimeVersion != "" {
- return e.Platform.Status.Build.RuntimeVersion
+ if e.Platform != nil && e.Platform.Status.Pipeline.RuntimeVersion != "" {
+ return e.Platform.Status.Pipeline.RuntimeVersion
}
return ""
}
diff --git a/pkg/trait/container_probes_test.go b/pkg/trait/container_probes_test.go
index f7d58a4f0..b7da7b4e7 100644
--- a/pkg/trait/container_probes_test.go
+++ b/pkg/trait/container_probes_test.go
@@ -50,7 +50,7 @@ func newTestProbesEnv(t *testing.T, integration *v1.Integration) Environment {
Status: v1.IntegrationPlatformStatus{
Phase: v1.IntegrationPlatformPhaseReady,
IntegrationPlatformSpec: v1.IntegrationPlatformSpec{
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
RuntimeVersion: catalog.Runtime.Version,
},
},
diff --git a/pkg/trait/container_test.go b/pkg/trait/container_test.go
index de1c29fe8..464c0003f 100644
--- a/pkg/trait/container_test.go
+++ b/pkg/trait/container_test.go
@@ -69,7 +69,7 @@ func TestContainerWithDefaults(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -135,7 +135,7 @@ func TestContainerWithCustomName(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -200,7 +200,7 @@ func TestContainerWithCustomImage(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -279,7 +279,7 @@ func TestContainerWithCustomImageAndIntegrationKit(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -324,7 +324,7 @@ func TestContainerWithImagePullPolicy(t *testing.T) {
},
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
RuntimeVersion: catalog.Runtime.Version,
},
},
diff --git a/pkg/trait/cron_test.go b/pkg/trait/cron_test.go
index dc00b2032..9b4107c4d 100644
--- a/pkg/trait/cron_test.go
+++ b/pkg/trait/cron_test.go
@@ -263,7 +263,7 @@ func TestCronDeps(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -342,7 +342,7 @@ func TestCronDepsFallback(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -421,7 +421,7 @@ func TestCronWithActiveDeadline(t *testing.T) {
},
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
RuntimeVersion: catalog.Runtime.Version,
},
},
@@ -504,7 +504,7 @@ func TestCronWithBackoffLimit(t *testing.T) {
},
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
RuntimeVersion: catalog.Runtime.Version,
},
},
diff --git a/pkg/trait/environment_test.go b/pkg/trait/environment_test.go
index 75f2d421d..1822b17bc 100644
--- a/pkg/trait/environment_test.go
+++ b/pkg/trait/environment_test.go
@@ -220,7 +220,7 @@ func mockEnvironment(catalog *camel.RuntimeCatalog) Environment {
},
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
RuntimeVersion: catalog.Runtime.Version,
},
},
diff --git a/pkg/trait/istio_test.go b/pkg/trait/istio_test.go
index d3cf638f4..fe15f1a06 100644
--- a/pkg/trait/istio_test.go
+++ b/pkg/trait/istio_test.go
@@ -61,7 +61,7 @@ func NewIstioTestEnv(t *testing.T, d *appsv1.Deployment, s *serving.Service, ena
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
Profile: v1.TraitProfileKnative,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
RuntimeVersion: catalog.Runtime.Version,
},
},
diff --git a/pkg/trait/knative_service_test.go b/pkg/trait/knative_service_test.go
index 6db7760d7..adfbc719c 100644
--- a/pkg/trait/knative_service_test.go
+++ b/pkg/trait/knative_service_test.go
@@ -101,7 +101,7 @@ func TestKnativeService(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -229,7 +229,7 @@ func TestKnativeServiceWithCustomContainerName(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -313,7 +313,7 @@ func TestKnativeServiceWithRest(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -380,7 +380,7 @@ func TestKnativeServiceNotApplicable(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -491,7 +491,7 @@ func createKnativeServiceTestEnvironment(t *testing.T, trait *traitv1.KnativeSer
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterKubernetes,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
RuntimeVersion: catalog.Runtime.Version,
},
},
diff --git a/pkg/trait/knative_test.go b/pkg/trait/knative_test.go
index b94abd157..6592b0af6 100644
--- a/pkg/trait/knative_test.go
+++ b/pkg/trait/knative_test.go
@@ -87,7 +87,7 @@ func TestKnativeEnvConfigurationFromTrait(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
},
@@ -207,7 +207,7 @@ func TestKnativeEnvConfigurationFromSource(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
},
@@ -395,7 +395,7 @@ func NewFakeEnvironment(t *testing.T, source v1.SourceSpec) Environment {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
diff --git a/pkg/trait/logging_test.go b/pkg/trait/logging_test.go
index 288cbfe21..d95c2b7b1 100644
--- a/pkg/trait/logging_test.go
+++ b/pkg/trait/logging_test.go
@@ -84,7 +84,7 @@ func createLoggingTestEnv(t *testing.T, color bool, json bool, jsonPrettyPrint b
Status: v1.IntegrationPlatformStatus{
Phase: v1.IntegrationPlatformPhaseReady,
IntegrationPlatformSpec: v1.IntegrationPlatformSpec{
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
RuntimeVersion: c.Runtime.Version,
},
},
diff --git a/pkg/trait/mount_test.go b/pkg/trait/mount_test.go
index 199597d9f..45afc51b9 100644
--- a/pkg/trait/mount_test.go
+++ b/pkg/trait/mount_test.go
@@ -172,7 +172,7 @@ func getNominalEnv(t *testing.T, traitCatalog *Catalog) *Environment {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
diff --git a/pkg/trait/openapi.go b/pkg/trait/openapi.go
index 5f2f8dc30..dde67e6f6 100644
--- a/pkg/trait/openapi.go
+++ b/pkg/trait/openapi.go
@@ -219,12 +219,12 @@ func (t *openAPITrait) createNewOpenAPIConfigMap(e *Environment, resource v1.Dat
}
mc := maven.NewContext(tmpDir)
- mc.LocalRepository = e.Platform.Status.Build.Maven.LocalRepository
- mc.AdditionalArguments = e.Platform.Status.Build.Maven.CLIOptions
+ mc.LocalRepository = e.Platform.Status.Pipeline.Maven.LocalRepository
+ mc.AdditionalArguments = e.Platform.Status.Pipeline.Maven.CLIOptions
mc.AddArgument("-Dopenapi.spec=" + in)
mc.AddArgument("-Ddsl.out=" + out)
- if settings, err := kubernetes.ResolveValueSource(e.Ctx, e.Client, e.Platform.Namespace, &e.Platform.Status.Build.Maven.Settings); err != nil {
+ if settings, err := kubernetes.ResolveValueSource(e.Ctx, e.Client, e.Platform.Namespace, &e.Platform.Status.Pipeline.Maven.Settings); err != nil {
return err
} else if settings != "" {
mc.UserSettings = []byte(settings)
@@ -239,7 +239,7 @@ func (t *openAPITrait) createNewOpenAPIConfigMap(e *Environment, resource v1.Dat
return err
}
mc.GlobalSettings = data
- secrets := e.Platform.Status.Build.Maven.CASecrets
+ secrets := e.Platform.Status.Pipeline.Maven.CASecrets
if secrets != nil {
certsData, err := kubernetes.GetSecretsRefData(e.Ctx, e.Client, e.Platform.Namespace, secrets)
@@ -258,7 +258,7 @@ func (t *openAPITrait) createNewOpenAPIConfigMap(e *Environment, resource v1.Dat
)
}
- ctx, cancel := context.WithTimeout(e.Ctx, e.Platform.Status.Build.GetTimeout().Duration)
+ ctx, cancel := context.WithTimeout(e.Ctx, e.Platform.Status.Pipeline.GetTimeout().Duration)
defer cancel()
err = project.Command(mc).Do(ctx)
if err != nil {
diff --git a/pkg/trait/pull_secret.go b/pkg/trait/pull_secret.go
index 640d9a341..2e4938435 100644
--- a/pkg/trait/pull_secret.go
+++ b/pkg/trait/pull_secret.go
@@ -55,7 +55,7 @@ func (t *pullSecretTrait) Configure(e *Environment) (bool, error) {
if pointer.BoolDeref(t.Auto, true) {
if t.SecretName == "" {
- secret := e.Platform.Status.Build.Registry.Secret
+ secret := e.Platform.Status.Pipeline.Registry.Secret
if secret != "" {
key := ctrl.ObjectKey{Namespace: e.Platform.Namespace, Name: secret}
obj := corev1.Secret{}
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index 0dfecb6c4..f98795a70 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -293,7 +293,7 @@ func propagateKitTraits(e *Environment) v1.IntegrationKitTraits {
}
func (t *quarkusTrait) applyWhenBuildSubmitted(e *Environment) error {
- build := getBuilderTask(e.BuildTasks)
+ build := getBuilderTask(e.Pipeline)
if build == nil {
return fmt.Errorf("unable to find builder task: %s", e.Integration.Name)
}
@@ -322,14 +322,14 @@ func (t *quarkusTrait) applyWhenBuildSubmitted(e *Environment) error {
}
steps = append(steps, builder.Image.NativeImageContext)
// Spectrum does not rely on Dockerfile to assemble the image
- if e.Platform.Status.Build.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategySpectrum {
+ if e.Platform.Status.Pipeline.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategySpectrum {
steps = append(steps, builder.Image.ExecutableDockerfile)
}
} else {
build.Maven.Properties["quarkus.package.type"] = string(traitv1.FastJarPackageType)
steps = append(steps, builder.Quarkus.ComputeQuarkusDependencies, builder.Image.IncrementalImageContext)
// Spectrum does not rely on Dockerfile to assemble the image
- if e.Platform.Status.Build.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategySpectrum {
+ if e.Platform.Status.Pipeline.PublishStrategy != v1.IntegrationPlatformBuildPublishStrategySpectrum {
steps = append(steps, builder.Image.JvmDockerfile)
}
}
diff --git a/pkg/trait/quarkus_test.go b/pkg/trait/quarkus_test.go
index 193e2ca42..3b4ab5de2 100644
--- a/pkg/trait/quarkus_test.go
+++ b/pkg/trait/quarkus_test.go
@@ -41,7 +41,7 @@ func TestConfigureQuarkusTraitBuildSubmitted(t *testing.T) {
err = quarkusTrait.Apply(environment)
assert.Nil(t, err)
- build := getBuilderTask(environment.BuildTasks)
+ build := getBuilderTask(environment.Pipeline)
assert.NotNil(t, t, build)
assert.Len(t, build.Steps, len(builder.Quarkus.CommonSteps)+3)
@@ -105,7 +105,7 @@ func createNominalQuarkusTest() (*quarkusTrait, *Environment) {
},
},
IntegrationKit: &v1.IntegrationKit{},
- BuildTasks: []v1.Task{
+ Pipeline: []v1.Task{
{
Builder: &v1.BuilderTask{},
},
diff --git a/pkg/trait/registry.go b/pkg/trait/registry.go
index 2e1b2fadb..395363210 100644
--- a/pkg/trait/registry.go
+++ b/pkg/trait/registry.go
@@ -63,16 +63,16 @@ func (t *registryTrait) Configure(e *Environment) (bool, error) {
}
func (t *registryTrait) Apply(e *Environment) error {
- registryAddress := e.Platform.Status.Build.Registry.Address
+ registryAddress := e.Platform.Status.Pipeline.Registry.Address
if registryAddress == "" && e.Platform.Status.Cluster == v1.IntegrationPlatformClusterOpenShift {
registryAddress = "image-registry.openshift-image-registry.svc:5000"
}
if registryAddress == "" {
return errors.New("could not figure out Image Registry URL, please set it manually")
}
- build := getBuilderTask(e.BuildTasks)
- registryCa := e.Platform.Status.Build.Registry.CA
- registrySecret := e.Platform.Status.Build.Registry.Secret
+ build := getBuilderTask(e.Pipeline)
+ registryCa := e.Platform.Status.Pipeline.Registry.CA
+ registrySecret := e.Platform.Status.Pipeline.Registry.Secret
if e.Platform.Status.Cluster == v1.IntegrationPlatformClusterOpenShift {
if registryCa == "" {
ca, err := getOpenShiftImageRegistryCA(e)
@@ -107,7 +107,7 @@ func (t *registryTrait) Apply(e *Environment) error {
}
func addRegistryAndExtensionToMaven(registryAddress string, build *v1.BuilderTask, platform *v1.IntegrationPlatform) {
- organization := platform.Status.Build.Registry.Organization
+ organization := platform.Status.Pipeline.Registry.Organization
if organization == "" {
organization = platform.Namespace
}
diff --git a/pkg/trait/route_test.go b/pkg/trait/route_test.go
index 73697cbfc..a02df9251 100644
--- a/pkg/trait/route_test.go
+++ b/pkg/trait/route_test.go
@@ -160,7 +160,7 @@ func createTestRouteEnvironment(t *testing.T, name string) *Environment {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
diff --git a/pkg/trait/service_test.go b/pkg/trait/service_test.go
index 6de827890..0f7c8d6c1 100644
--- a/pkg/trait/service_test.go
+++ b/pkg/trait/service_test.go
@@ -92,7 +92,7 @@ func TestServiceWithDefaults(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -201,7 +201,7 @@ func TestService(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -288,7 +288,7 @@ func TestServiceWithCustomContainerName(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -379,7 +379,7 @@ func TestServiceWithNodePort(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -473,7 +473,7 @@ func TestServiceWithKnativeServiceEnabled(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -536,7 +536,7 @@ func TestServicesWithKnativeProfile(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
@@ -600,7 +600,7 @@ func TestServiceWithKnativeServiceDisabledInIntegrationPlatform(t *testing.T) {
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: v1.IntegrationPlatformClusterOpenShift,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
PublishStrategy: v1.IntegrationPlatformBuildPublishStrategyS2I,
Registry: v1.RegistrySpec{Address: "registry"},
RuntimeVersion: catalog.Runtime.Version,
diff --git a/pkg/trait/trait_test.go b/pkg/trait/trait_test.go
index df38dc472..91cca3b00 100644
--- a/pkg/trait/trait_test.go
+++ b/pkg/trait/trait_test.go
@@ -529,7 +529,7 @@ func createTestEnv(t *testing.T, cluster v1.IntegrationPlatformCluster, script s
Platform: &v1.IntegrationPlatform{
Spec: v1.IntegrationPlatformSpec{
Cluster: cluster,
- Build: v1.IntegrationPlatformBuildSpec{
+ Pipeline: v1.IntegrationPlatformPipelineSpec{
RuntimeVersion: catalog.Runtime.Version,
},
},
diff --git a/pkg/trait/trait_types.go b/pkg/trait/trait_types.go
index b7f1f4886..6937b265b 100644
--- a/pkg/trait/trait_types.go
+++ b/pkg/trait/trait_types.go
@@ -187,7 +187,7 @@ type Environment struct {
PostActions []func(*Environment) error
PostStepProcessors []func(*Environment) error
PostProcessors []func(*Environment) error
- BuildTasks []v1.Task
+ Pipeline []v1.Task
ConfiguredTraits []Trait
ExecutedTraits []Trait
EnvVars []corev1.EnvVar