This is an automated email from the ASF dual-hosted git repository.
squakez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push:
new 22435879a feat(platform): complete IntegrationProfile
22435879a is described below
commit 22435879af501e1470a5c3f58c018564b9e3ed30
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Sat Aug 29 09:01:38 2026 +0200
feat(platform): complete IntegrationProfile
Feature parity between IntegrationProfile and IntegrationPlatform
Closes #6705
---
.../ROOT/pages/configuration/configuration.adoc | 5 +
.../pages/configuration/integrationprofiles.adoc | 33 ++-
docs/modules/ROOT/partials/apis/camel-k-crds.adoc | 238 ++++++++++++---------
e2e/advanced/integration_profile_test.go | 192 -----------------
helm/camel-k/crds/camel-k-crds.yaml | 164 ++++++++++++--
pkg/apis/camel/v1/common_types.go | 4 -
pkg/apis/camel/v1/common_types_support.go | 7 -
pkg/apis/camel/v1/integrationprofile_types.go | 53 ++---
.../camel/v1/integrationprofile_types_support.go | 14 +-
pkg/apis/camel/v1/zz_generated.deepcopy.go | 100 +++++----
...go => deprecatedintegrationprofilecondition.go} | 26 +--
...us.go => deprecatedintegrationprofilestatus.go} | 30 +--
.../camel/v1/integrationprofile.go | 10 +-
.../camel/v1/integrationprofilebuildspec.go | 66 ++++--
pkg/client/camel/applyconfiguration/utils.go | 8 +-
.../versioned/typed/camel/v1/integrationprofile.go | 4 -
pkg/cmd/operator/operator.go | 26 +--
pkg/cmd/run.go | 9 +-
pkg/controller/build/build_controller.go | 13 +-
pkg/controller/integration/monitor.go | 9 -
pkg/controller/integrationkit/build.go | 5 -
pkg/controller/pipe/monitor.go | 8 +-
pkg/platform/env_platform.go | 134 ++++++++++--
pkg/platform/env_platform_test.go | 72 ++++++-
pkg/platform/operator.go | 5 -
pkg/platform/profile.go | 19 +-
pkg/platform/profile_test.go | 62 ------
.../camel.apache.org_integrationprofiles.yaml | 164 ++++++++++++--
pkg/trait/quarkus.go | 9 -
pkg/trait/trait.go | 13 +-
pkg/trait/trait_test.go | 104 ++++++++-
pkg/util/camel/camel_runtime_test.go | 6 +-
pkg/util/digest/digest.go | 4 -
33 files changed, 962 insertions(+), 654 deletions(-)
diff --git a/docs/modules/ROOT/pages/configuration/configuration.adoc
b/docs/modules/ROOT/pages/configuration/configuration.adoc
index 7991cafb1..feb4be274 100644
--- a/docs/modules/ROOT/pages/configuration/configuration.adoc
+++ b/docs/modules/ROOT/pages/configuration/configuration.adoc
@@ -29,3 +29,8 @@ Another configuration you may be interested in controlling is
the xref:configura
== Deployment configuration
The goal of the operator is to simplify the building and deployment process of
a Camel application on the cloud. Most of the time the default settings to
configure the deployment resources should be enough. However, if you need to
fine tune the final resulting deployment, then you need to know how to
configure the so called xref:traits:traits.adoc[Camel K traits].
+
+== Integration Profiles
+
+When you're managing a cluster with several users and namespace it will turn
useful the `IntegrationProfile` custom resource. This can be used to specify
different common configuration that an `Integration` can inherit, just by
annotating the `Integration` resource properly. You can learn more in the
xref:configuration/integrationprofiles.adoc[IntegrationProfile] section.
+
diff --git a/docs/modules/ROOT/pages/configuration/integrationprofiles.adoc
b/docs/modules/ROOT/pages/configuration/integrationprofiles.adoc
index 8867b8ad6..013896558 100644
--- a/docs/modules/ROOT/pages/configuration/integrationprofiles.adoc
+++ b/docs/modules/ROOT/pages/configuration/integrationprofiles.adoc
@@ -1,6 +1,6 @@
= Integration Profiles
-Users may add an IntegrationProfile resource to any namespace. The profile
holds custom settings which can be applied to all Integrations.
+Admin users may add an `IntegrationProfile` resource to any namespace. The
profile holds custom settings which can be applied to all Integrations.
The profile must be explicitly selected by an annotation referencing the
integration profile name (any resource belonging to the "camel.apache.org"
group can select a particular profile configuration).
@@ -36,4 +36,33 @@ spec:
# ...
----
-The selection of a IntegrationProfile enables new configuration scenarios, for
example, sharing global configuration options for groups of Integrations. The
main configuration expected here is related to traits.
+The selection of a IntegrationProfile enables new configuration scenarios, for
example, sharing global configuration options for groups of Integrations.
+
+== Security
+
+The `IntegrationProfile` is the secure way to provide sensitive building
information and common configuration. For example, you can provide a common
security configuration to access securely to a container registry. Or, as seen
above a common runtime configuration (traits) to adopt. The profile contains
all the configuration required for the operator to build, package and run the
application. Here a quick snapshot of the main parameters (see more in the API
definition):
+
+[source,yaml]
+----
+kind: IntegrationProfile
+apiVersion: camel.apache.org/v1
+metadata:
+ name: my-profile
+spec:
+ build:
+ ...
+ registry:
+ ...
+ maven:
+ ...
+ repositories:
+ ...
+ dependencies:
+ ...
+ traits:
+ ...
+----
+
+The presence of the profile overrides the default operator configuration which
is normally configured via environment variables.
+
+NOTE: each Integration can use any IntegrationProfile available in their
namespace.
diff --git a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
index aeb1eb4f6..dbaeea7b7 100644
--- a/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
+++ b/docs/modules/ROOT/partials/apis/camel-k-crds.adoc
@@ -257,7 +257,7 @@ Refer to the Kubernetes API documentation for the fields of
the `metadata` field
|`status` +
-*xref:#_camel_apache_org_v1_IntegrationProfileStatus[IntegrationProfileStatus]*
+*xref:#_camel_apache_org_v1_DeprecatedIntegrationProfileStatus[DeprecatedIntegrationProfileStatus]*
|
@@ -582,6 +582,7 @@ BuildConditionType -- .
* <<#_camel_apache_org_v1_BaseTask, BaseTask>>
* <<#_camel_apache_org_v1_BuildSpec, BuildSpec>>
* <<#_camel_apache_org_v1_IntegrationPlatformBuildSpec,
IntegrationPlatformBuildSpec>>
+* <<#_camel_apache_org_v1_IntegrationProfileBuildSpec,
IntegrationProfileBuildSpec>>
BuildConfiguration represent the configuration required to build the runtime.
@@ -1803,6 +1804,114 @@ one to many data type specifications
one to many header specifications
+|===
+
+[#_camel_apache_org_v1_DeprecatedIntegrationProfileCondition]
+=== DeprecatedIntegrationProfileCondition
+
+*Appears on:*
+
+* <<#_camel_apache_org_v1_DeprecatedIntegrationProfileStatus,
DeprecatedIntegrationProfileStatus>>
+
+DeprecatedIntegrationProfileCondition describes the state of a resource at a
certain point.
+
+Deprecated: no longer in use.
+
+[cols="2,2a",options="header"]
+|===
+|Field
+|Description
+
+|`type` +
+*xref:#_camel_apache_org_v1_IntegrationProfileConditionType[IntegrationProfileConditionType]*
+|
+
+
+Type of integration condition.
+
+|`status` +
+*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.36/#conditionstatus-v1-core[Kubernetes
core/v1.ConditionStatus]*
+|
+
+
+Status of the condition, one of True, False, Unknown.
+
+|`lastUpdateTime` +
+*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.36/#time-v1-meta[Kubernetes
meta/v1.Time]*
+|
+
+
+The last time this condition was updated.
+
+|`lastTransitionTime` +
+*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.36/#time-v1-meta[Kubernetes
meta/v1.Time]*
+|
+
+
+Last time the condition transitioned from one status to another.
+
+|`reason` +
+string
+|
+
+
+The reason for the condition's last transition.
+
+|`message` +
+string
+|
+
+
+A human-readable message indicating details about the transition.
+
+
+|===
+
+[#_camel_apache_org_v1_DeprecatedIntegrationProfileStatus]
+=== DeprecatedIntegrationProfileStatus
+
+*Appears on:*
+
+* <<#_camel_apache_org_v1_IntegrationProfile, IntegrationProfile>>
+
+DeprecatedIntegrationProfileStatus defines the observed state of
IntegrationProfile.
+
+Deprecated: no longer in use.
+
+[cols="2,2a",options="header"]
+|===
+|Field
+|Description
+
+|`IntegrationProfileSpec` +
+*xref:#_camel_apache_org_v1_IntegrationProfileSpec[IntegrationProfileSpec]*
+|(Members of `IntegrationProfileSpec` are embedded into this type.)
+
+
+
+
+|`observedGeneration` +
+int64
+|
+
+
+ObservedGeneration is the most recent generation observed for this
IntegrationProfile.
+
+|`phase` +
+*xref:#_camel_apache_org_v1_IntegrationProfilePhase[IntegrationProfilePhase]*
+|
+
+
+defines in what phase the IntegrationProfile is found
+
+|`conditions` +
+*xref:#_camel_apache_org_v1_DeprecatedIntegrationProfileCondition[[\]DeprecatedIntegrationProfileCondition]*
+|
+
+
+which are the conditions met (particularly useful when in ERROR phase)
+
+
|===
[#_camel_apache_org_v1_Endpoint]
@@ -2864,6 +2973,7 @@ IntegrationPhase --.
*Appears on:*
* <<#_camel_apache_org_v1_IntegrationPlatformBuildSpec,
IntegrationPlatformBuildSpec>>
+* <<#_camel_apache_org_v1_IntegrationProfileBuildSpec,
IntegrationProfileBuildSpec>>
IntegrationPlatformBuildPublishStrategy defines the strategy used to package
and publish an Integration base image.
@@ -3234,19 +3344,19 @@ This configuration can be used to tune the behavior of
the Integration/Integrati
|Field
|Description
-|`runtimeVersion` +
-string
+|`runtimeProvider` +
+*xref:#_camel_apache_org_v1_RuntimeProvider[RuntimeProvider]*
|
-the Camel K Runtime dependency version
+the runtime provider to use. Likely Camel Quarkus.
-|`runtimeProvider` +
-*xref:#_camel_apache_org_v1_RuntimeProvider[RuntimeProvider]*
+|`runtimeVersion` +
+string
|
-the runtime used. Likely Camel Quarkus (we used to have main runtime which has
been discontinued since version 1.5)
+the runtime dependency version to use.
|`baseImage` +
string
@@ -3275,66 +3385,35 @@ how much time to wait before time out the pipeline
process
|
-Maven configuration used to build the Camel/Camel-Quarkus applications
-
-
-|===
-
-[#_camel_apache_org_v1_IntegrationProfileCondition]
-=== IntegrationProfileCondition
-
-*Appears on:*
-
-* <<#_camel_apache_org_v1_IntegrationProfileStatus, IntegrationProfileStatus>>
-
-IntegrationProfileCondition describes the state of a resource at a certain
point.
-
-[cols="2,2a",options="header"]
-|===
-|Field
-|Description
-
-|`type` +
-*xref:#_camel_apache_org_v1_IntegrationProfileConditionType[IntegrationProfileConditionType]*
-|
-
-
-Type of integration condition.
-
-|`status` +
-*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.36/#conditionstatus-v1-core[Kubernetes
core/v1.ConditionStatus]*
-|
+Maven configuration used to build the Camel applications
-
-Status of the condition, one of True, False, Unknown.
-
-|`lastUpdateTime` +
-*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.36/#time-v1-meta[Kubernetes
meta/v1.Time]*
+|`repositories` +
+[]string
|
-The last time this condition was updated.
+Maven repositories used to build the Camel applications
-|`lastTransitionTime` +
-*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.36/#time-v1-meta[Kubernetes
meta/v1.Time]*
-|
+|`BuildConfiguration` +
+*xref:#_camel_apache_org_v1_BuildConfiguration[BuildConfiguration]*
+|(Members of `BuildConfiguration` are embedded into this type.)
-Last time the condition transitioned from one status to another.
+the configuration required to build an Integration container image
-|`reason` +
-string
+|`publishStrategy` +
+*xref:#_camel_apache_org_v1_IntegrationPlatformBuildPublishStrategy[IntegrationPlatformBuildPublishStrategy]*
|
-The reason for the condition's last transition.
+the strategy to adopt for publishing an Integration container image
-|`message` +
-string
+|`maxRunningBuilds` +
+int32
|
-A human-readable message indicating details about the transition.
+the maximum amount of parallel running pipelines started by this operator
instance
|===
@@ -3344,10 +3423,12 @@ A human-readable message indicating details about the
transition.
*Appears on:*
-* <<#_camel_apache_org_v1_IntegrationProfileCondition,
IntegrationProfileCondition>>
+* <<#_camel_apache_org_v1_DeprecatedIntegrationProfileCondition,
DeprecatedIntegrationProfileCondition>>
IntegrationProfileConditionType defines the type of condition.
+Deprecated: no longer in use.
+
[#_camel_apache_org_v1_IntegrationProfileKameletSpec]
=== IntegrationProfileKameletSpec
@@ -3380,10 +3461,12 @@ remote repository used to retrieve Kamelet catalog
*Appears on:*
-* <<#_camel_apache_org_v1_IntegrationProfileStatus, IntegrationProfileStatus>>
+* <<#_camel_apache_org_v1_DeprecatedIntegrationProfileStatus,
DeprecatedIntegrationProfileStatus>>
IntegrationProfilePhase is the phase of an IntegrationProfile.
+Deprecated: no longer in use.
+
[#_camel_apache_org_v1_IntegrationProfileSpec]
=== IntegrationProfileSpec
@@ -3391,7 +3474,7 @@ IntegrationProfilePhase is the phase of an
IntegrationProfile.
*Appears on:*
* <<#_camel_apache_org_v1_IntegrationProfile, IntegrationProfile>>
-* <<#_camel_apache_org_v1_IntegrationProfileStatus, IntegrationProfileStatus>>
+* <<#_camel_apache_org_v1_DeprecatedIntegrationProfileStatus,
DeprecatedIntegrationProfileStatus>>
IntegrationProfileSpec applies user defined settings to the IntegrationProfile.
@@ -3431,51 +3514,6 @@ configuration to be executed to all Kamelets controlled
by this IntegrationProfi
Deprecated: to be removed in future versions.
-|===
-
-[#_camel_apache_org_v1_IntegrationProfileStatus]
-=== IntegrationProfileStatus
-
-*Appears on:*
-
-* <<#_camel_apache_org_v1_IntegrationProfile, IntegrationProfile>>
-
-IntegrationProfileStatus defines the observed state of IntegrationProfile.
-
-[cols="2,2a",options="header"]
-|===
-|Field
-|Description
-
-|`IntegrationProfileSpec` +
-*xref:#_camel_apache_org_v1_IntegrationProfileSpec[IntegrationProfileSpec]*
-|(Members of `IntegrationProfileSpec` are embedded into this type.)
-
-
-
-
-|`observedGeneration` +
-int64
-|
-
-
-ObservedGeneration is the most recent generation observed for this
IntegrationProfile.
-
-|`phase` +
-*xref:#_camel_apache_org_v1_IntegrationProfilePhase[IntegrationProfilePhase]*
-|
-
-
-defines in what phase the IntegrationProfile is found
-
-|`conditions` +
-*xref:#_camel_apache_org_v1_IntegrationProfileCondition[[\]IntegrationProfileCondition]*
-|
-
-
-which are the conditions met (particularly useful when in ERROR phase)
-
-
|===
[#_camel_apache_org_v1_IntegrationSpec]
diff --git a/e2e/advanced/integration_profile_test.go
b/e2e/advanced/integration_profile_test.go
deleted file mode 100644
index 0df2d72d3..000000000
--- a/e2e/advanced/integration_profile_test.go
+++ /dev/null
@@ -1,192 +0,0 @@
-//go:build integration
-// +build integration
-
-// To enable compilation of this file in Goland, go to "Settings -> Go ->
Vendoring & Build Tags -> Custom Tags" and add "integration"
-
-/*
-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.
-*/
-
-package advanced
-
-import (
- "context"
- "testing"
-
- . "github.com/onsi/gomega"
-
- corev1 "k8s.io/api/core/v1"
-
- . "github.com/apache/camel-k/v2/e2e/support"
- v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
- traitv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1/trait"
- "github.com/apache/camel-k/v2/pkg/util/defaults"
-)
-
-func TestIntegrationProfile(t *testing.T) {
- t.Parallel()
-
- WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
- operatorID := "camel-k-integration-profile"
- InstallOperatorWithConf(t, ctx, g, ns, operatorID, true, nil)
-
- integrationProfile := v1.NewIntegrationProfile(ns, "ipr-global")
- integrationProfile.SetOperatorID(operatorID)
- integrationProfile.Spec.Traits.Container =
&traitv1.ContainerTrait{
- Name: "ck-integration-global",
- LimitCPU: "0.3",
- }
-
- g.Expect(CreateIntegrationProfile(t, ctx,
&integrationProfile)).To(Succeed())
-
- WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns1
string) {
- integrationProfile := v1.NewIntegrationProfile(ns1,
"ipr-local")
- integrationProfile.SetOperatorID(operatorID)
- integrationProfile.Spec.Traits.Container =
&traitv1.ContainerTrait{
- LimitCPU: "0.2",
- }
- g.Expect(CreateIntegrationProfile(t, ctx,
&integrationProfile)).To(Succeed())
-
- t.Run("Run integration with global integration
profile", func(t *testing.T) {
- g.Expect(KamelRunWithID(t, ctx, operatorID, ns1,
- "--name", "limited",
"--integration-profile", "ipr-global",
"files/yaml.yaml").Execute()).To(Succeed())
-
- g.Eventually(IntegrationPod(t, ctx, ns1,
"limited"), TestTimeoutMedium).Should(Not(BeNil()))
- g.Eventually(IntegrationPodHas(t, ctx, ns1,
"limited", func(pod *corev1.Pod) bool {
- if len(pod.Spec.Containers) != 1 {
- return false
- }
- containerName :=
pod.Spec.Containers[0].Name
- return containerName ==
"ck-integration-global"
- }), TestTimeoutShort).Should(BeTrue())
- g.Eventually(IntegrationPodHas(t, ctx, ns1,
"limited", func(pod *corev1.Pod) bool {
- if len(pod.Spec.Containers) != 1 {
- return false
- }
- cpuLimits :=
pod.Spec.Containers[0].Resources.Limits.Cpu()
- return cpuLimits != nil &&
cpuLimits.AsApproximateFloat64() > 0
- }), TestTimeoutShort).Should(BeTrue())
- g.Expect(Kamel(t, ctx, "delete", "limited",
"-n", ns1).Execute()).To(Succeed())
- })
-
- t.Run("Run integration with namespace local integration
profile", func(t *testing.T) {
- g.Expect(KamelRunWithID(t, ctx, operatorID,
ns1, "--name", "limited", "--integration-profile", "ipr-local",
"files/yaml.yaml").Execute()).To(Succeed())
-
- g.Eventually(IntegrationPod(t, ctx, ns1,
"limited"), TestTimeoutMedium).Should(Not(BeNil()))
- g.Eventually(IntegrationPodHas(t, ctx, ns1,
"limited", func(pod *corev1.Pod) bool {
- if len(pod.Spec.Containers) != 1 {
- return false
- }
- containerName :=
pod.Spec.Containers[0].Name
- return containerName == "integration"
- }), TestTimeoutShort).Should(BeTrue())
-
- g.Eventually(IntegrationPodHas(t, ctx, ns1,
"limited", func(pod *corev1.Pod) bool {
- if len(pod.Spec.Containers) != 1 {
- return false
- }
- cpuLimits :=
pod.Spec.Containers[0].Resources.Limits.Cpu()
- return cpuLimits != nil &&
cpuLimits.AsApproximateFloat64() > 0
- }), TestTimeoutShort).Should(BeTrue())
- g.Expect(Kamel(t, ctx, "delete", "limited",
"-n", ns1).Execute()).To(Succeed())
- })
- })
- })
-}
-
-func TestIntegrationProfileInfluencesKit(t *testing.T) {
- t.Parallel()
-
- WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
- operatorID := "camel-k-ipr-kit"
- InstallOperatorWithConf(t, ctx, g, ns, operatorID, false, nil)
-
- integrationProfile := v1.NewIntegrationProfile(ns, "ipr-global")
- integrationProfile.SetOperatorID(operatorID)
- integrationProfile.Spec.Traits.Builder = &traitv1.BuilderTrait{
- Properties: []string{"b1=foo"},
- }
-
- g.Expect(CreateIntegrationProfile(t, ctx,
&integrationProfile)).To(Succeed())
-
- g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "--name",
"normal", "files/yaml.yaml").Execute()).To(Succeed())
- g.Eventually(IntegrationConditionStatus(t, ctx, ns, "normal",
v1.IntegrationConditionReady),
TestTimeoutMedium).Should(Equal(corev1.ConditionTrue))
- g.Eventually(IntegrationPod(t, ctx, ns, "normal"),
TestTimeoutMedium).Should(Not(BeNil()))
- g.Eventually(IntegrationPodPhase(t, ctx, ns, "normal"),
TestTimeoutMedium).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationLogs(t, ctx, ns, "normal"),
TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
- // Verify that a new kit has been built based on the default
base image
- integrationKitName := IntegrationKitName(t, ctx, ns, "normal")()
- g.Eventually(Kit(t, ctx, ns,
integrationKitName)().Status.BaseImage).Should(Equal(defaults.BaseImage()))
- g.Eventually(Kit(t, ctx, ns,
integrationKitName)().Status.RootImage).Should(Equal(defaults.BaseImage()))
-
- g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "--name",
"simple", "--integration-profile", "ipr-global",
"files/yaml.yaml").Execute()).To(Succeed())
-
- g.Eventually(IntegrationConditionStatus(t, ctx, ns, "simple",
v1.IntegrationConditionReady),
TestTimeoutMedium).Should(Equal(corev1.ConditionTrue))
- g.Eventually(IntegrationPod(t, ctx, ns, "simple"),
TestTimeoutMedium).Should(Not(BeNil()))
- g.Eventually(IntegrationPodPhase(t, ctx, ns, "simple"),
TestTimeoutMedium).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationLogs(t, ctx, ns, "simple"),
TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
-
- // Verify that a new kit has been built based on the previous
kit
- integrationKitNameWithProfile := IntegrationKitName(t, ctx, ns,
"simple")()
-
g.Eventually(integrationKitNameWithProfile).ShouldNot(Equal(integrationKitName))
- g.Eventually(Kit(t, ctx, ns,
integrationKitNameWithProfile)().Status.BaseImage).Should(ContainSubstring(integrationKitName))
- g.Eventually(Kit(t, ctx, ns,
integrationKitNameWithProfile)().Status.RootImage).Should(Equal(defaults.BaseImage()))
- })
-}
-
-func TestPropagateIntegrationProfileChanges(t *testing.T) {
- t.Parallel()
-
- WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
- operatorID := "camel-k-ipr-changes"
- InstallOperatorWithConf(t, ctx, g, ns, operatorID, false, nil)
-
- integrationProfile := v1.NewIntegrationProfile(ns,
"debug-profile")
- integrationProfile.SetOperatorID(operatorID)
- integrationProfile.Spec.Traits.Container =
&traitv1.ContainerTrait{
- Name: "ck-ipr",
- }
- integrationProfile.Spec.Traits.Logging = &traitv1.LoggingTrait{
- Level: "DEBUG",
- }
-
- g.Expect(CreateIntegrationProfile(t, ctx,
&integrationProfile)).To(Succeed())
- g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "--name",
"simple", "--integration-profile", "debug-profile",
"files/yaml.yaml").Execute()).To(Succeed())
-
- g.Eventually(IntegrationPod(t, ctx, ns, "simple"),
TestTimeoutMedium).Should(Not(BeNil()))
- g.Eventually(IntegrationPodHas(t, ctx, ns, "simple", func(pod
*corev1.Pod) bool {
- if len(pod.Spec.Containers) != 1 {
- return false
- }
- containerName := pod.Spec.Containers[0].Name
- return containerName == "ck-ipr"
- }), TestTimeoutShort).Should(BeTrue())
-
- g.Expect(UpdateIntegrationProfile(t, ctx, ns, func(ipr
*v1.IntegrationProfile) {
- ipr.Spec.Traits.Container = &traitv1.ContainerTrait{
- Name: "ck-ipr-new",
- }
- })).To(Succeed())
-
- g.Eventually(IntegrationPodHas(t, ctx, ns, "simple", func(pod
*corev1.Pod) bool {
- if len(pod.Spec.Containers) != 1 {
- return false
- }
- containerName := pod.Spec.Containers[0].Name
- return containerName == "ck-ipr-new"
- }), TestTimeoutShort).Should(BeTrue())
- })
-}
diff --git a/helm/camel-k/crds/camel-k-crds.yaml
b/helm/camel-k/crds/camel-k-crds.yaml
index 1d65f87c2..2675f27d3 100644
--- a/helm/camel-k/crds/camel-k-crds.yaml
+++ b/helm/camel-k/crds/camel-k-crds.yaml
@@ -8477,14 +8477,27 @@ spec:
build:
description: specify how to build the
Integration/IntegrationKits
properties:
+ annotations:
+ additionalProperties:
+ type: string
+ description: Annotation to use for the builder pod. Only
used
+ for `pod` 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 software
type: string
+ 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
maven:
- description: Maven configuration used to build the
Camel/Camel-Quarkus
- applications
+ description: Maven configuration used to build the Camel
applications
properties:
caSecrets:
description: |-
@@ -8722,6 +8735,40 @@ spec:
x-kubernetes-map-type: atomic
type: object
type: object
+ maxRunningBuilds:
+ description: the maximum amount of parallel running
pipelines
+ started by this operator instance
+ format: int32
+ type: integer
+ nodeSelector:
+ additionalProperties:
+ type: string
+ description: The node selector for the builder pod. Only
used
+ for `pod` strategy
+ type: object
+ operatorNamespace:
+ description: |-
+ The namespace where to run the builder Pod (must be the
same of the operator in charge of this Build reconciliation).
+
+ Deprecated: no longer in use.
+ type: string
+ orderStrategy:
+ description: the build order strategy to adopt
+ enum:
+ - dependencies
+ - fifo
+ - sequential
+ type: string
+ platforms:
+ description: The list of platforms used in order to build
a container
+ image.
+ items:
+ type: string
+ type: array
+ 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
@@ -8743,18 +8790,38 @@ spec:
description: the secret where credentials are stored
type: string
type: object
+ repositories:
+ description: Maven repositories used to build the Camel
applications
+ items:
+ type: string
+ type: array
+ 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
runtimeProvider:
- description: the runtime used. Likely Camel Quarkus (we
used to
- have main runtime which has been discontinued since
version
- 1.5)
+ description: the runtime provider to use. Likely Camel
Quarkus.
type: string
runtimeVersion:
- description: the Camel K Runtime dependency version
+ description: the runtime dependency version to use.
+ type: string
+ strategy:
+ description: the strategy to adopt
+ enum:
+ - routine
+ - pod
type: string
timeout:
description: how much time to wait before time out the
pipeline
process
type: string
+ toolImage:
+ description: The container image to be used to run the
build.
+ type: string
type: object
dependencies:
description: a list of dependencies needed by the application
@@ -10854,14 +10921,27 @@ spec:
build:
description: specify how to build the
Integration/IntegrationKits
properties:
+ annotations:
+ additionalProperties:
+ type: string
+ description: Annotation to use for the builder pod. Only
used
+ for `pod` 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 software
type: string
+ 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
maven:
- description: Maven configuration used to build the
Camel/Camel-Quarkus
- applications
+ description: Maven configuration used to build the Camel
applications
properties:
caSecrets:
description: |-
@@ -11099,6 +11179,40 @@ spec:
x-kubernetes-map-type: atomic
type: object
type: object
+ maxRunningBuilds:
+ description: the maximum amount of parallel running
pipelines
+ started by this operator instance
+ format: int32
+ type: integer
+ nodeSelector:
+ additionalProperties:
+ type: string
+ description: The node selector for the builder pod. Only
used
+ for `pod` strategy
+ type: object
+ operatorNamespace:
+ description: |-
+ The namespace where to run the builder Pod (must be the
same of the operator in charge of this Build reconciliation).
+
+ Deprecated: no longer in use.
+ type: string
+ orderStrategy:
+ description: the build order strategy to adopt
+ enum:
+ - dependencies
+ - fifo
+ - sequential
+ type: string
+ platforms:
+ description: The list of platforms used in order to build
a container
+ image.
+ items:
+ type: string
+ type: array
+ 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
@@ -11120,25 +11234,47 @@ spec:
description: the secret where credentials are stored
type: string
type: object
+ repositories:
+ description: Maven repositories used to build the Camel
applications
+ items:
+ type: string
+ type: array
+ 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
runtimeProvider:
- description: the runtime used. Likely Camel Quarkus (we
used to
- have main runtime which has been discontinued since
version
- 1.5)
+ description: the runtime provider to use. Likely Camel
Quarkus.
type: string
runtimeVersion:
- description: the Camel K Runtime dependency version
+ description: the runtime dependency version to use.
+ type: string
+ strategy:
+ description: the strategy to adopt
+ enum:
+ - routine
+ - pod
type: string
timeout:
description: how much time to wait before time out the
pipeline
process
type: string
+ toolImage:
+ description: The container image to be used to run the
build.
+ type: string
type: object
conditions:
description: which are the conditions met (particularly useful
when
in ERROR phase)
items:
- description: IntegrationProfileCondition describes the state
of
- a resource at a certain point.
+ description: |-
+ DeprecatedIntegrationProfileCondition describes the state
of a resource at a certain point.
+
+ Deprecated: no longer in use.
properties:
lastTransitionTime:
description: Last time the condition transitioned from
one status
diff --git a/pkg/apis/camel/v1/common_types.go
b/pkg/apis/camel/v1/common_types.go
index f03573405..aa0b9122c 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -36,10 +36,6 @@ const (
PlatformSelectorAnnotation = "camel.apache.org/platform.id"
// IntegrationProfileAnnotation integration profile id annotation label.
IntegrationProfileAnnotation = "camel.apache.org/integration-profile.id"
- // IntegrationProfileNamespaceAnnotation integration profile id
annotation label.
- //
- // Deprecated: won't be supported in future releases.
- IntegrationProfileNamespaceAnnotation =
"camel.apache.org/integration-profile.namespace"
// IntegrationDontRunAfterBuildAnnotation -- .
IntegrationDontRunAfterBuildAnnotation =
"camel.apache.org/dont-run-after-build"
// IntegrationDontRunAfterBuildAnnotationTrueValue -- .
diff --git a/pkg/apis/camel/v1/common_types_support.go
b/pkg/apis/camel/v1/common_types_support.go
index 2e590d044..d79d10453 100644
--- a/pkg/apis/camel/v1/common_types_support.go
+++ b/pkg/apis/camel/v1/common_types_support.go
@@ -176,13 +176,6 @@ func GetIntegrationProfileAnnotation(obj metav1.Object)
string {
return GetAnnotation(IntegrationProfileAnnotation, obj)
}
-// GetIntegrationProfileNamespaceAnnotation to safely get the integration
profile namespace annotation value.
-//
-// Deprecated: won't be supported in future releases.
-func GetIntegrationProfileNamespaceAnnotation(obj metav1.Object) string {
- return GetAnnotation(IntegrationProfileNamespaceAnnotation, obj)
-}
-
// GetAnnotation safely get the annotation value.
func GetAnnotation(name string, obj metav1.Object) string {
if obj == nil || obj.GetAnnotations() == nil {
diff --git a/pkg/apis/camel/v1/integrationprofile_types.go
b/pkg/apis/camel/v1/integrationprofile_types.go
index 8370c957e..65e2def81 100644
--- a/pkg/apis/camel/v1/integrationprofile_types.go
+++ b/pkg/apis/camel/v1/integrationprofile_types.go
@@ -39,8 +39,10 @@ type IntegrationProfileSpec struct {
Kamelet IntegrationProfileKameletSpec `json:"kamelet,omitempty"`
}
-// IntegrationProfileStatus defines the observed state of IntegrationProfile.
-type IntegrationProfileStatus struct {
+// DeprecatedIntegrationProfileStatus defines the observed state of
IntegrationProfile.
+//
+// Deprecated: no longer in use.
+type DeprecatedIntegrationProfileStatus struct {
IntegrationProfileSpec `json:",inline"`
// ObservedGeneration is the most recent generation observed for this
IntegrationProfile.
@@ -48,7 +50,7 @@ type IntegrationProfileStatus struct {
// defines in what phase the IntegrationProfile is found
Phase IntegrationProfilePhase `json:"phase,omitempty"`
// which are the conditions met (particularly useful when in ERROR
phase)
- Conditions []IntegrationProfileCondition `json:"conditions,omitempty"`
+ Conditions []DeprecatedIntegrationProfileCondition
`json:"conditions,omitempty"`
}
// +genclient
@@ -65,7 +67,7 @@ type IntegrationProfile struct {
Spec IntegrationProfileSpec `json:"spec,omitempty"`
// Deprecated: no longer in use.
- Status IntegrationProfileStatus `json:"status,omitempty"`
+ DeprecatedStatus DeprecatedIntegrationProfileStatus
`json:"status,omitempty"`
}
// +kubebuilder:object:root=true
@@ -81,19 +83,27 @@ type IntegrationProfileList struct {
// IntegrationProfileBuildSpec contains profile related build information.
// This configuration can be used to tune the behavior of the
Integration/IntegrationKit image builds.
type IntegrationProfileBuildSpec struct {
- // 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)
+ // the runtime provider to use. Likely Camel Quarkus.
RuntimeProvider RuntimeProvider `json:"runtimeProvider,omitempty"`
+ // the runtime dependency version to use.
+ RuntimeVersion string `json:"runtimeVersion,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 software
BaseImage string `json:"baseImage,omitempty"`
// the image registry used to push/pull Integration images
- Registry RegistrySpec `json:"registry,omitempty"`
+ Registry *RegistrySpec `json:"registry,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"`
+ // Maven configuration used to build the Camel applications
+ Maven *MavenSpec `json:"maven,omitempty"`
+ // Maven repositories used to build the Camel applications
+ Repositories []string `json:"repositories,omitempty"`
+ // the configuration required to build an Integration container image
+ BuildConfiguration BuildConfiguration `json:",inline"`
+ // the strategy to adopt for publishing an Integration container image
+ PublishStrategy IntegrationPlatformBuildPublishStrategy
`json:"publishStrategy,omitempty"`
+ // the maximum amount of parallel running pipelines started by this
operator instance
+ MaxRunningBuilds int32 `json:"maxRunningBuilds,omitempty"`
}
// IntegrationProfileKameletSpec define the behavior for all the Kamelets
controller by the IntegrationProfile.
@@ -105,31 +115,24 @@ type IntegrationProfileKameletSpec struct {
}
// IntegrationProfilePhase is the phase of an IntegrationProfile.
+//
+// Deprecated: no longer in use.
type IntegrationProfilePhase string
// IntegrationProfileConditionType defines the type of condition.
+//
+// Deprecated: no longer in use.
type IntegrationProfileConditionType string
const (
// IntegrationProfileKind is the Kind name of the IntegrationProfile CR.
IntegrationProfileKind string = "IntegrationProfile"
-
- // IntegrationProfilePhaseNone when the IntegrationProfile does not
exist.
- IntegrationProfilePhaseNone IntegrationProfilePhase = ""
- // IntegrationProfilePhaseReady when the IntegrationProfile is ready.
- IntegrationProfilePhaseReady IntegrationProfilePhase = "Ready"
- // IntegrationProfilePhaseError when the IntegrationProfile had some
error (see Conditions).
- IntegrationProfilePhaseError IntegrationProfilePhase = "Error"
-
- // IntegrationProfileConditionTypeCreated is the condition if the
IntegrationProfile has been created.
- IntegrationProfileConditionTypeCreated IntegrationProfileConditionType
= "Created"
-
- // IntegrationProfileConditionCreatedReason represents the reason that
the IntegrationProfile is created.
- IntegrationProfileConditionCreatedReason = "IntegrationProfileCreated"
)
-// IntegrationProfileCondition describes the state of a resource at a certain
point.
-type IntegrationProfileCondition struct {
+// DeprecatedIntegrationProfileCondition describes the state of a resource at
a certain point.
+//
+// Deprecated: no longer in use.
+type DeprecatedIntegrationProfileCondition struct {
// Type of integration condition.
Type IntegrationProfileConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
diff --git a/pkg/apis/camel/v1/integrationprofile_types_support.go
b/pkg/apis/camel/v1/integrationprofile_types_support.go
index 07d4a5ee1..011659977 100644
--- a/pkg/apis/camel/v1/integrationprofile_types_support.go
+++ b/pkg/apis/camel/v1/integrationprofile_types_support.go
@@ -50,34 +50,34 @@ func (b *IntegrationProfileBuildSpec) GetTimeout()
metav1.Duration {
return *b.Timeout
}
-var _ ResourceCondition = &IntegrationProfileCondition{}
+var _ ResourceCondition = &DeprecatedIntegrationProfileCondition{}
// GetType --.
-func (c *IntegrationProfileCondition) GetType() string {
+func (c *DeprecatedIntegrationProfileCondition) GetType() string {
return string(c.Type)
}
// GetStatus --.
-func (c *IntegrationProfileCondition) GetStatus() corev1.ConditionStatus {
+func (c *DeprecatedIntegrationProfileCondition) GetStatus()
corev1.ConditionStatus {
return c.Status
}
// GetLastUpdateTime --.
-func (c *IntegrationProfileCondition) GetLastUpdateTime() metav1.Time {
+func (c *DeprecatedIntegrationProfileCondition) GetLastUpdateTime()
metav1.Time {
return c.LastUpdateTime
}
// GetLastTransitionTime --.
-func (c *IntegrationProfileCondition) GetLastTransitionTime() metav1.Time {
+func (c *DeprecatedIntegrationProfileCondition) GetLastTransitionTime()
metav1.Time {
return c.LastTransitionTime
}
// GetReason --.
-func (c *IntegrationProfileCondition) GetReason() string {
+func (c *DeprecatedIntegrationProfileCondition) GetReason() string {
return c.Reason
}
// GetMessage --.
-func (c *IntegrationProfileCondition) GetMessage() string {
+func (c *DeprecatedIntegrationProfileCondition) GetMessage() string {
return c.Message
}
diff --git a/pkg/apis/camel/v1/zz_generated.deepcopy.go
b/pkg/apis/camel/v1/zz_generated.deepcopy.go
index da6c9f1e1..1d11e35a2 100644
--- a/pkg/apis/camel/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/camel/v1/zz_generated.deepcopy.go
@@ -805,6 +805,46 @@ func (in *DataTypesSpec) DeepCopy() *DataTypesSpec {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
+func (in *DeprecatedIntegrationProfileCondition) DeepCopyInto(out
*DeprecatedIntegrationProfileCondition) {
+ *out = *in
+ in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime)
+ in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new DeprecatedIntegrationProfileCondition.
+func (in *DeprecatedIntegrationProfileCondition) DeepCopy()
*DeprecatedIntegrationProfileCondition {
+ if in == nil {
+ return nil
+ }
+ out := new(DeprecatedIntegrationProfileCondition)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
+func (in *DeprecatedIntegrationProfileStatus) DeepCopyInto(out
*DeprecatedIntegrationProfileStatus) {
+ *out = *in
+ in.IntegrationProfileSpec.DeepCopyInto(&out.IntegrationProfileSpec)
+ if in.Conditions != nil {
+ in, out := &in.Conditions, &out.Conditions
+ *out = make([]DeprecatedIntegrationProfileCondition, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new DeprecatedIntegrationProfileStatus.
+func (in *DeprecatedIntegrationProfileStatus) DeepCopy()
*DeprecatedIntegrationProfileStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(DeprecatedIntegrationProfileStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
func (in *Endpoint) DeepCopyInto(out *Endpoint) {
*out = *in
@@ -1637,7 +1677,7 @@ func (in *IntegrationProfile) DeepCopyInto(out
*IntegrationProfile) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
- in.Status.DeepCopyInto(&out.Status)
+ in.DeprecatedStatus.DeepCopyInto(&out.DeprecatedStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new IntegrationProfile.
@@ -1661,13 +1701,27 @@ func (in *IntegrationProfile) DeepCopyObject()
runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
func (in *IntegrationProfileBuildSpec) DeepCopyInto(out
*IntegrationProfileBuildSpec) {
*out = *in
- out.Registry = in.Registry
+ if in.Registry != nil {
+ in, out := &in.Registry, &out.Registry
+ *out = new(RegistrySpec)
+ **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.Maven != nil {
+ in, out := &in.Maven, &out.Maven
+ *out = new(MavenSpec)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Repositories != nil {
+ in, out := &in.Repositories, &out.Repositories
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ in.BuildConfiguration.DeepCopyInto(&out.BuildConfiguration)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new IntegrationProfileBuildSpec.
@@ -1680,23 +1734,6 @@ func (in *IntegrationProfileBuildSpec) DeepCopy()
*IntegrationProfileBuildSpec {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
-func (in *IntegrationProfileCondition) DeepCopyInto(out
*IntegrationProfileCondition) {
- *out = *in
- in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime)
- in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new IntegrationProfileCondition.
-func (in *IntegrationProfileCondition) DeepCopy() *IntegrationProfileCondition
{
- if in == nil {
- return nil
- }
- out := new(IntegrationProfileCondition)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
func (in *IntegrationProfileKameletSpec) DeepCopyInto(out
*IntegrationProfileKameletSpec) {
*out = *in
@@ -1772,29 +1809,6 @@ func (in *IntegrationProfileSpec) DeepCopy()
*IntegrationProfileSpec {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
-func (in *IntegrationProfileStatus) DeepCopyInto(out
*IntegrationProfileStatus) {
- *out = *in
- in.IntegrationProfileSpec.DeepCopyInto(&out.IntegrationProfileSpec)
- if in.Conditions != nil {
- in, out := &in.Conditions, &out.Conditions
- *out = make([]IntegrationProfileCondition, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver,
creating a new IntegrationProfileStatus.
-func (in *IntegrationProfileStatus) DeepCopy() *IntegrationProfileStatus {
- if in == nil {
- return nil
- }
- out := new(IntegrationProfileStatus)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver,
writing into out. in must be non-nil.
func (in *IntegrationSpec) DeepCopyInto(out *IntegrationSpec) {
*out = *in
diff --git
a/pkg/client/camel/applyconfiguration/camel/v1/integrationprofilecondition.go
b/pkg/client/camel/applyconfiguration/camel/v1/deprecatedintegrationprofilecondition.go
similarity index 68%
rename from
pkg/client/camel/applyconfiguration/camel/v1/integrationprofilecondition.go
rename to
pkg/client/camel/applyconfiguration/camel/v1/deprecatedintegrationprofilecondition.go
index cb09cb2b9..8fe731450 100644
---
a/pkg/client/camel/applyconfiguration/camel/v1/integrationprofilecondition.go
+++
b/pkg/client/camel/applyconfiguration/camel/v1/deprecatedintegrationprofilecondition.go
@@ -25,11 +25,13 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// IntegrationProfileConditionApplyConfiguration represents a declarative
configuration of the IntegrationProfileCondition type for use
+// DeprecatedIntegrationProfileConditionApplyConfiguration represents a
declarative configuration of the DeprecatedIntegrationProfileCondition type for
use
// with apply.
//
-// IntegrationProfileCondition describes the state of a resource at a certain
point.
-type IntegrationProfileConditionApplyConfiguration struct {
+// DeprecatedIntegrationProfileCondition describes the state of a resource at
a certain point.
+//
+// Deprecated: no longer in use.
+type DeprecatedIntegrationProfileConditionApplyConfiguration struct {
// Type of integration condition.
Type *camelv1.IntegrationProfileConditionType `json:"type,omitempty"`
// Status of the condition, one of True, False, Unknown.
@@ -44,16 +46,16 @@ type IntegrationProfileConditionApplyConfiguration struct {
Message *string `json:"message,omitempty"`
}
-// IntegrationProfileConditionApplyConfiguration constructs a declarative
configuration of the IntegrationProfileCondition type for use with
+// DeprecatedIntegrationProfileConditionApplyConfiguration constructs a
declarative configuration of the DeprecatedIntegrationProfileCondition type for
use with
// apply.
-func IntegrationProfileCondition()
*IntegrationProfileConditionApplyConfiguration {
- return &IntegrationProfileConditionApplyConfiguration{}
+func DeprecatedIntegrationProfileCondition()
*DeprecatedIntegrationProfileConditionApplyConfiguration {
+ return &DeprecatedIntegrationProfileConditionApplyConfiguration{}
}
// WithType sets the Type 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 Type field is set to the value of the last
call.
-func (b *IntegrationProfileConditionApplyConfiguration) WithType(value
camelv1.IntegrationProfileConditionType)
*IntegrationProfileConditionApplyConfiguration {
+func (b *DeprecatedIntegrationProfileConditionApplyConfiguration)
WithType(value camelv1.IntegrationProfileConditionType)
*DeprecatedIntegrationProfileConditionApplyConfiguration {
b.Type = &value
return b
}
@@ -61,7 +63,7 @@ func (b *IntegrationProfileConditionApplyConfiguration)
WithType(value camelv1.I
// WithStatus sets the Status 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 Status field is set to the value of the last
call.
-func (b *IntegrationProfileConditionApplyConfiguration) WithStatus(value
corev1.ConditionStatus) *IntegrationProfileConditionApplyConfiguration {
+func (b *DeprecatedIntegrationProfileConditionApplyConfiguration)
WithStatus(value corev1.ConditionStatus)
*DeprecatedIntegrationProfileConditionApplyConfiguration {
b.Status = &value
return b
}
@@ -69,7 +71,7 @@ func (b *IntegrationProfileConditionApplyConfiguration)
WithStatus(value corev1.
// WithLastUpdateTime sets the LastUpdateTime 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 LastUpdateTime field is set to the value of
the last call.
-func (b *IntegrationProfileConditionApplyConfiguration)
WithLastUpdateTime(value metav1.Time)
*IntegrationProfileConditionApplyConfiguration {
+func (b *DeprecatedIntegrationProfileConditionApplyConfiguration)
WithLastUpdateTime(value metav1.Time)
*DeprecatedIntegrationProfileConditionApplyConfiguration {
b.LastUpdateTime = &value
return b
}
@@ -77,7 +79,7 @@ func (b *IntegrationProfileConditionApplyConfiguration)
WithLastUpdateTime(value
// WithLastTransitionTime sets the LastTransitionTime 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 LastTransitionTime field is set to the value
of the last call.
-func (b *IntegrationProfileConditionApplyConfiguration)
WithLastTransitionTime(value metav1.Time)
*IntegrationProfileConditionApplyConfiguration {
+func (b *DeprecatedIntegrationProfileConditionApplyConfiguration)
WithLastTransitionTime(value metav1.Time)
*DeprecatedIntegrationProfileConditionApplyConfiguration {
b.LastTransitionTime = &value
return b
}
@@ -85,7 +87,7 @@ func (b *IntegrationProfileConditionApplyConfiguration)
WithLastTransitionTime(v
// WithReason sets the Reason 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 Reason field is set to the value of the last
call.
-func (b *IntegrationProfileConditionApplyConfiguration) WithReason(value
string) *IntegrationProfileConditionApplyConfiguration {
+func (b *DeprecatedIntegrationProfileConditionApplyConfiguration)
WithReason(value string)
*DeprecatedIntegrationProfileConditionApplyConfiguration {
b.Reason = &value
return b
}
@@ -93,7 +95,7 @@ func (b *IntegrationProfileConditionApplyConfiguration)
WithReason(value string)
// WithMessage sets the Message 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 Message field is set to the value of the last
call.
-func (b *IntegrationProfileConditionApplyConfiguration) WithMessage(value
string) *IntegrationProfileConditionApplyConfiguration {
+func (b *DeprecatedIntegrationProfileConditionApplyConfiguration)
WithMessage(value string)
*DeprecatedIntegrationProfileConditionApplyConfiguration {
b.Message = &value
return b
}
diff --git
a/pkg/client/camel/applyconfiguration/camel/v1/integrationprofilestatus.go
b/pkg/client/camel/applyconfiguration/camel/v1/deprecatedintegrationprofilestatus.go
similarity index 67%
rename from
pkg/client/camel/applyconfiguration/camel/v1/integrationprofilestatus.go
rename to
pkg/client/camel/applyconfiguration/camel/v1/deprecatedintegrationprofilestatus.go
index bdde2b41e..867ba0ca9 100644
--- a/pkg/client/camel/applyconfiguration/camel/v1/integrationprofilestatus.go
+++
b/pkg/client/camel/applyconfiguration/camel/v1/deprecatedintegrationprofilestatus.go
@@ -23,30 +23,32 @@ import (
camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
-// IntegrationProfileStatusApplyConfiguration represents a declarative
configuration of the IntegrationProfileStatus type for use
+// DeprecatedIntegrationProfileStatusApplyConfiguration represents a
declarative configuration of the DeprecatedIntegrationProfileStatus type for use
// with apply.
//
-// IntegrationProfileStatus defines the observed state of IntegrationProfile.
-type IntegrationProfileStatusApplyConfiguration struct {
+// DeprecatedIntegrationProfileStatus defines the observed state of
IntegrationProfile.
+//
+// Deprecated: no longer in use.
+type DeprecatedIntegrationProfileStatusApplyConfiguration struct {
IntegrationProfileSpecApplyConfiguration `json:",inline"`
// ObservedGeneration is the most recent generation observed for this
IntegrationProfile.
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
// defines in what phase the IntegrationProfile is found
Phase *camelv1.IntegrationProfilePhase `json:"phase,omitempty"`
// which are the conditions met (particularly useful when in ERROR
phase)
- Conditions []IntegrationProfileConditionApplyConfiguration
`json:"conditions,omitempty"`
+ Conditions []DeprecatedIntegrationProfileConditionApplyConfiguration
`json:"conditions,omitempty"`
}
-// IntegrationProfileStatusApplyConfiguration constructs a declarative
configuration of the IntegrationProfileStatus type for use with
+// DeprecatedIntegrationProfileStatusApplyConfiguration constructs a
declarative configuration of the DeprecatedIntegrationProfileStatus type for
use with
// apply.
-func IntegrationProfileStatus() *IntegrationProfileStatusApplyConfiguration {
- return &IntegrationProfileStatusApplyConfiguration{}
+func DeprecatedIntegrationProfileStatus()
*DeprecatedIntegrationProfileStatusApplyConfiguration {
+ return &DeprecatedIntegrationProfileStatusApplyConfiguration{}
}
// WithBuild sets the Build 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 Build field is set to the value of the last
call.
-func (b *IntegrationProfileStatusApplyConfiguration) WithBuild(value
*IntegrationProfileBuildSpecApplyConfiguration)
*IntegrationProfileStatusApplyConfiguration {
+func (b *DeprecatedIntegrationProfileStatusApplyConfiguration) WithBuild(value
*IntegrationProfileBuildSpecApplyConfiguration)
*DeprecatedIntegrationProfileStatusApplyConfiguration {
b.IntegrationProfileSpecApplyConfiguration.Build = value
return b
}
@@ -54,7 +56,7 @@ func (b *IntegrationProfileStatusApplyConfiguration)
WithBuild(value *Integratio
// 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.
-func (b *IntegrationProfileStatusApplyConfiguration) WithTraits(value
*TraitsApplyConfiguration) *IntegrationProfileStatusApplyConfiguration {
+func (b *DeprecatedIntegrationProfileStatusApplyConfiguration)
WithTraits(value *TraitsApplyConfiguration)
*DeprecatedIntegrationProfileStatusApplyConfiguration {
b.IntegrationProfileSpecApplyConfiguration.Traits = value
return b
}
@@ -62,7 +64,7 @@ func (b *IntegrationProfileStatusApplyConfiguration)
WithTraits(value *TraitsApp
// WithDependencies adds the given value to the Dependencies 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 Dependencies field.
-func (b *IntegrationProfileStatusApplyConfiguration) WithDependencies(values
...string) *IntegrationProfileStatusApplyConfiguration {
+func (b *DeprecatedIntegrationProfileStatusApplyConfiguration)
WithDependencies(values ...string)
*DeprecatedIntegrationProfileStatusApplyConfiguration {
for i := range values {
b.IntegrationProfileSpecApplyConfiguration.Dependencies =
append(b.IntegrationProfileSpecApplyConfiguration.Dependencies, values[i])
}
@@ -72,7 +74,7 @@ func (b *IntegrationProfileStatusApplyConfiguration)
WithDependencies(values ...
// WithKamelet sets the Kamelet 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 Kamelet field is set to the value of the last
call.
-func (b *IntegrationProfileStatusApplyConfiguration) WithKamelet(value
*IntegrationProfileKameletSpecApplyConfiguration)
*IntegrationProfileStatusApplyConfiguration {
+func (b *DeprecatedIntegrationProfileStatusApplyConfiguration)
WithKamelet(value *IntegrationProfileKameletSpecApplyConfiguration)
*DeprecatedIntegrationProfileStatusApplyConfiguration {
b.IntegrationProfileSpecApplyConfiguration.Kamelet = value
return b
}
@@ -80,7 +82,7 @@ func (b *IntegrationProfileStatusApplyConfiguration)
WithKamelet(value *Integrat
// WithObservedGeneration sets the ObservedGeneration 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 ObservedGeneration field is set to the value
of the last call.
-func (b *IntegrationProfileStatusApplyConfiguration)
WithObservedGeneration(value int64) *IntegrationProfileStatusApplyConfiguration
{
+func (b *DeprecatedIntegrationProfileStatusApplyConfiguration)
WithObservedGeneration(value int64)
*DeprecatedIntegrationProfileStatusApplyConfiguration {
b.ObservedGeneration = &value
return b
}
@@ -88,7 +90,7 @@ func (b *IntegrationProfileStatusApplyConfiguration)
WithObservedGeneration(valu
// WithPhase sets the Phase 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 Phase field is set to the value of the last
call.
-func (b *IntegrationProfileStatusApplyConfiguration) WithPhase(value
camelv1.IntegrationProfilePhase) *IntegrationProfileStatusApplyConfiguration {
+func (b *DeprecatedIntegrationProfileStatusApplyConfiguration) WithPhase(value
camelv1.IntegrationProfilePhase)
*DeprecatedIntegrationProfileStatusApplyConfiguration {
b.Phase = &value
return b
}
@@ -96,7 +98,7 @@ func (b *IntegrationProfileStatusApplyConfiguration)
WithPhase(value camelv1.Int
// WithConditions adds the given value to the Conditions 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 Conditions field.
-func (b *IntegrationProfileStatusApplyConfiguration) WithConditions(values
...*IntegrationProfileConditionApplyConfiguration)
*IntegrationProfileStatusApplyConfiguration {
+func (b *DeprecatedIntegrationProfileStatusApplyConfiguration)
WithConditions(values
...*DeprecatedIntegrationProfileConditionApplyConfiguration)
*DeprecatedIntegrationProfileStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithConditions")
diff --git a/pkg/client/camel/applyconfiguration/camel/v1/integrationprofile.go
b/pkg/client/camel/applyconfiguration/camel/v1/integrationprofile.go
index 088c38438..db1e08e52 100644
--- a/pkg/client/camel/applyconfiguration/camel/v1/integrationprofile.go
+++ b/pkg/client/camel/applyconfiguration/camel/v1/integrationprofile.go
@@ -35,7 +35,7 @@ type IntegrationProfileApplyConfiguration struct {
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec
*IntegrationProfileSpecApplyConfiguration `json:"spec,omitempty"`
// Deprecated: no longer in use.
- Status *IntegrationProfileStatusApplyConfiguration
`json:"status,omitempty"`
+ DeprecatedStatus *DeprecatedIntegrationProfileStatusApplyConfiguration
`json:"status,omitempty"`
}
// IntegrationProfile constructs a declarative configuration of the
IntegrationProfile type for use with
@@ -217,11 +217,11 @@ func (b *IntegrationProfileApplyConfiguration)
WithSpec(value *IntegrationProfil
return b
}
-// WithStatus sets the Status field in the declarative configuration to the
given value
+// WithDeprecatedStatus sets the DeprecatedStatus 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 Status field is set to the value of the last
call.
-func (b *IntegrationProfileApplyConfiguration) WithStatus(value
*IntegrationProfileStatusApplyConfiguration)
*IntegrationProfileApplyConfiguration {
- b.Status = value
+// If called multiple times, the DeprecatedStatus field is set to the value of
the last call.
+func (b *IntegrationProfileApplyConfiguration) WithDeprecatedStatus(value
*DeprecatedIntegrationProfileStatusApplyConfiguration)
*IntegrationProfileApplyConfiguration {
+ b.DeprecatedStatus = value
return b
}
diff --git
a/pkg/client/camel/applyconfiguration/camel/v1/integrationprofilebuildspec.go
b/pkg/client/camel/applyconfiguration/camel/v1/integrationprofilebuildspec.go
index a4c695be5..c2a6626cc 100644
---
a/pkg/client/camel/applyconfiguration/camel/v1/integrationprofilebuildspec.go
+++
b/pkg/client/camel/applyconfiguration/camel/v1/integrationprofilebuildspec.go
@@ -30,10 +30,10 @@ import (
// IntegrationProfileBuildSpec contains profile related build information.
// This configuration can be used to tune the behavior of the
Integration/IntegrationKit image builds.
type IntegrationProfileBuildSpecApplyConfiguration struct {
- // 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)
+ // the runtime provider to use. Likely Camel Quarkus.
RuntimeProvider *camelv1.RuntimeProvider
`json:"runtimeProvider,omitempty"`
+ // the runtime dependency version to use.
+ RuntimeVersion *string `json:"runtimeVersion,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 software
BaseImage *string `json:"baseImage,omitempty"`
@@ -41,8 +41,16 @@ type IntegrationProfileBuildSpecApplyConfiguration struct {
Registry *RegistrySpecApplyConfiguration `json:"registry,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 configuration used to build the Camel applications
Maven *MavenSpecApplyConfiguration `json:"maven,omitempty"`
+ // Maven repositories used to build the Camel applications
+ Repositories []string `json:"repositories,omitempty"`
+ // the configuration required to build an Integration container image
+ BuildConfiguration *BuildConfigurationApplyConfiguration
`json:",inline"`
+ // the strategy to adopt for publishing an Integration container image
+ PublishStrategy *camelv1.IntegrationPlatformBuildPublishStrategy
`json:"publishStrategy,omitempty"`
+ // the maximum amount of parallel running pipelines started by this
operator instance
+ MaxRunningBuilds *int32 `json:"maxRunningBuilds,omitempty"`
}
// IntegrationProfileBuildSpecApplyConfiguration constructs a declarative
configuration of the IntegrationProfileBuildSpec type for use with
@@ -51,14 +59,6 @@ func IntegrationProfileBuildSpec()
*IntegrationProfileBuildSpecApplyConfiguratio
return &IntegrationProfileBuildSpecApplyConfiguration{}
}
-// 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 *IntegrationProfileBuildSpecApplyConfiguration)
WithRuntimeVersion(value string) *IntegrationProfileBuildSpecApplyConfiguration
{
- 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.
@@ -67,6 +67,14 @@ func (b *IntegrationProfileBuildSpecApplyConfiguration)
WithRuntimeProvider(valu
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 *IntegrationProfileBuildSpecApplyConfiguration)
WithRuntimeVersion(value string) *IntegrationProfileBuildSpecApplyConfiguration
{
+ b.RuntimeVersion = &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.
@@ -98,3 +106,37 @@ func (b *IntegrationProfileBuildSpecApplyConfiguration)
WithMaven(value *MavenSp
b.Maven = value
return b
}
+
+// WithRepositories adds the given value to the Repositories 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 Repositories field.
+func (b *IntegrationProfileBuildSpecApplyConfiguration)
WithRepositories(values ...string)
*IntegrationProfileBuildSpecApplyConfiguration {
+ for i := range values {
+ b.Repositories = append(b.Repositories, values[i])
+ }
+ return b
+}
+
+// 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 *IntegrationProfileBuildSpecApplyConfiguration)
WithBuildConfiguration(value *BuildConfigurationApplyConfiguration)
*IntegrationProfileBuildSpecApplyConfiguration {
+ 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 *IntegrationProfileBuildSpecApplyConfiguration)
WithPublishStrategy(value camelv1.IntegrationPlatformBuildPublishStrategy)
*IntegrationProfileBuildSpecApplyConfiguration {
+ b.PublishStrategy = &value
+ return b
+}
+
+// WithMaxRunningBuilds sets the MaxRunningBuilds 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 MaxRunningBuilds field is set to the value of
the last call.
+func (b *IntegrationProfileBuildSpecApplyConfiguration)
WithMaxRunningBuilds(value int32)
*IntegrationProfileBuildSpecApplyConfiguration {
+ b.MaxRunningBuilds = &value
+ return b
+}
diff --git a/pkg/client/camel/applyconfiguration/utils.go
b/pkg/client/camel/applyconfiguration/utils.go
index a1adeb4f0..c48f05ab8 100644
--- a/pkg/client/camel/applyconfiguration/utils.go
+++ b/pkg/client/camel/applyconfiguration/utils.go
@@ -89,6 +89,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &camelv1.DataTypeSpecApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("DataTypesSpec"):
return &camelv1.DataTypesSpecApplyConfiguration{}
+ case
v1.SchemeGroupVersion.WithKind("DeprecatedIntegrationProfileCondition"):
+ return
&camelv1.DeprecatedIntegrationProfileConditionApplyConfiguration{}
+ case
v1.SchemeGroupVersion.WithKind("DeprecatedIntegrationProfileStatus"):
+ return
&camelv1.DeprecatedIntegrationProfileStatusApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("Endpoint"):
return &camelv1.EndpointApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("EndpointProperties"):
@@ -141,14 +145,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &camelv1.IntegrationProfileApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("IntegrationProfileBuildSpec"):
return &camelv1.IntegrationProfileBuildSpecApplyConfiguration{}
- case v1.SchemeGroupVersion.WithKind("IntegrationProfileCondition"):
- return &camelv1.IntegrationProfileConditionApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("IntegrationProfileKameletSpec"):
return
&camelv1.IntegrationProfileKameletSpecApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("IntegrationProfileSpec"):
return &camelv1.IntegrationProfileSpecApplyConfiguration{}
- case v1.SchemeGroupVersion.WithKind("IntegrationProfileStatus"):
- return &camelv1.IntegrationProfileStatusApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("IntegrationSpec"):
return &camelv1.IntegrationSpecApplyConfiguration{}
case v1.SchemeGroupVersion.WithKind("IntegrationStatus"):
diff --git
a/pkg/client/camel/clientset/versioned/typed/camel/v1/integrationprofile.go
b/pkg/client/camel/clientset/versioned/typed/camel/v1/integrationprofile.go
index 279271f8f..d4043bfd2 100644
--- a/pkg/client/camel/clientset/versioned/typed/camel/v1/integrationprofile.go
+++ b/pkg/client/camel/clientset/versioned/typed/camel/v1/integrationprofile.go
@@ -41,8 +41,6 @@ type IntegrationProfilesGetter interface {
type IntegrationProfileInterface interface {
Create(ctx context.Context, integrationProfile
*camelv1.IntegrationProfile, opts metav1.CreateOptions)
(*camelv1.IntegrationProfile, error)
Update(ctx context.Context, integrationProfile
*camelv1.IntegrationProfile, opts metav1.UpdateOptions)
(*camelv1.IntegrationProfile, error)
- // Add a +genclient:noStatus comment above the type to avoid generating
UpdateStatus().
- UpdateStatus(ctx context.Context, integrationProfile
*camelv1.IntegrationProfile, opts metav1.UpdateOptions)
(*camelv1.IntegrationProfile, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions)
error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions,
listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions)
(*camelv1.IntegrationProfile, error)
@@ -50,8 +48,6 @@ type IntegrationProfileInterface interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface,
error)
Patch(ctx context.Context, name string, pt types.PatchType, data
[]byte, opts metav1.PatchOptions, subresources ...string) (result
*camelv1.IntegrationProfile, err error)
Apply(ctx context.Context, integrationProfile
*applyconfigurationcamelv1.IntegrationProfileApplyConfiguration, opts
metav1.ApplyOptions) (result *camelv1.IntegrationProfile, err error)
- // Add a +genclient:noStatus comment above the type to avoid generating
ApplyStatus().
- ApplyStatus(ctx context.Context, integrationProfile
*applyconfigurationcamelv1.IntegrationProfileApplyConfiguration, opts
metav1.ApplyOptions) (result *camelv1.IntegrationProfile, err error)
IntegrationProfileExpansion
}
diff --git a/pkg/cmd/operator/operator.go b/pkg/cmd/operator/operator.go
index c108aa573..f606fcac2 100644
--- a/pkg/cmd/operator/operator.go
+++ b/pkg/cmd/operator/operator.go
@@ -223,8 +223,8 @@ func Run(healthPort, monitoringPort int32, leaderElection
bool, leaderElectionID
exitOnError(err, "")
log.Info("Configuring manager")
- // Verify the environment platform configuration
- checkRegistry()
+ // Initialize environment platform configuration
+ platform.InitPlatform()
exitOnError(mgr.AddHealthzCheck("health-probe", healthz.Ping), "Unable
add liveness check")
exitOnError(apis.AddToScheme(mgr.GetScheme()), "")
ctrlClient, err := client.FromManager(mgr)
@@ -246,28 +246,6 @@ func Run(healthPort, monitoringPort int32, leaderElection
bool, leaderElectionID
exitOnError(mgr.Start(ctx), "manager exited non-zero")
}
-func checkRegistry() {
- // The operator will eventually try to get the registry address from an
IntegrationPlatform, if provided
- if platform.SingletonPlatform.Registry.Address == "" {
- // TODO: fail fast exiting the program when we don't support
IntegrationPlatform.
- log.Info("Failed to initialize singleton platform from
environment variables: missing mandatory env var REGISTRY_ADDRESS. " +
- "Mind that this will be required when we stop
supporting IntegrationPlatform in future releases.")
- } else {
- // TODO: support registry in IntegrationProfile before removing
IntegrationPlatform.
- log.Infof("Registry %s configured for this operator. "+
- "The operator will use this one unless any other
specified in IntegrationPlatform (deprecated)",
- platform.SingletonPlatform.Registry.Address)
- }
- if platform.SingletonPlatform.Registry.Insecure {
- log.Info("The registry may be accessed insecurely via http (non
encrypted) protocol: " +
- "make sure this is disabled in a production environment
for security reasons.")
- }
- if platform.SingletonPlatform.Registry.Secret == "" {
- log.Info("The registry will access publicly (no secret
configured): " +
- "make sure this is disabled in a production environment
for security reasons.")
- }
-}
-
func getNamespacesSelector(operatorNamespace string, watchNamespace string)
map[string]cache.Config {
namespacesSelector := map[string]cache.Config{
// The same operator namespace is needed while the operator
stores
diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go
index 0c17fe94e..dd44cbf3d 100644
--- a/pkg/cmd/run.go
+++ b/pkg/cmd/run.go
@@ -721,14 +721,7 @@ func (o *runCmdOptions) applyAnnotations(it
*v1.Integration) {
// --integration-profile={id} is a syntax sugar for '--annotation
camel.apache.org/integration-profile.id={id}'
if o.IntegrationProfile != "" {
- if strings.Contains(o.IntegrationProfile, "/") {
- namespacedName := strings.SplitN(o.IntegrationProfile,
"/", 2)
- //nolint:staticcheck
- v1.SetAnnotation(&it.ObjectMeta,
v1.IntegrationProfileNamespaceAnnotation, namespacedName[0])
- v1.SetAnnotation(&it.ObjectMeta,
v1.IntegrationProfileAnnotation, namespacedName[1])
- } else {
- v1.SetAnnotation(&it.ObjectMeta,
v1.IntegrationProfileAnnotation, o.IntegrationProfile)
- }
+ v1.SetAnnotation(&it.ObjectMeta,
v1.IntegrationProfileAnnotation, o.IntegrationProfile)
}
for _, annotation := range o.Annotations {
diff --git a/pkg/controller/build/build_controller.go
b/pkg/controller/build/build_controller.go
index 998f7164e..4a08a2f43 100644
--- a/pkg/controller/build/build_controller.go
+++ b/pkg/controller/build/build_controller.go
@@ -151,17 +151,12 @@ func (r *reconcileBuild) Reconcile(ctx context.Context,
request reconcile.Reques
var actions []Action
- pl := platform.SingletonPlatform
- ip, err := platform.GetForResource(ctx, r.client, &instance)
- if err == nil {
- // NOTE: whatever is the error we don't really care. If a
deprecated platform exists, then
- // we use it. Otherwise we use the conf coming from env var
- pl = platform.FromIntegrationPlatform(ip)
- }
+ ip, _ := platform.GetForResource(ctx, r.client, &instance)
+ envPlatform := platform.GetPlatform(ip, nil)
buildMonitor := Monitor{
- maxRunningBuilds: pl.MaxRunningBuilds,
- buildOrderStrategy: pl.BuildConfiguration.OrderStrategy,
+ maxRunningBuilds: envPlatform.MaxRunningBuilds,
+ buildOrderStrategy:
envPlatform.BuildConfiguration.OrderStrategy,
}
switch instance.BuilderConfiguration().Strategy {
diff --git a/pkg/controller/integration/monitor.go
b/pkg/controller/integration/monitor.go
index db446e5b1..e7f56661d 100644
--- a/pkg/controller/integration/monitor.go
+++ b/pkg/controller/integration/monitor.go
@@ -310,15 +310,6 @@ func isIntegrationKitResetRequired(integration
*v1.Integration, kit *v1.Integrat
return true
}
- //nolint:staticcheck
- if v1.GetIntegrationProfileNamespaceAnnotation(integration) != "" &&
- //nolint:staticcheck
- v1.GetIntegrationProfileNamespaceAnnotation(integration) !=
v1.GetIntegrationProfileNamespaceAnnotation(kit) {
- // Integration profile namespace for the integration has
changed. Reset integration kit
- // so new profile can be applied
- return true
- }
-
return false
}
diff --git a/pkg/controller/integrationkit/build.go
b/pkg/controller/integrationkit/build.go
index ab830f8a9..95414a095 100644
--- a/pkg/controller/integrationkit/build.go
+++ b/pkg/controller/integrationkit/build.go
@@ -119,11 +119,6 @@ func (action *buildAction) createBuild(ctx
context.Context, kit *v1.IntegrationK
if v, ok := kit.Annotations[v1.IntegrationProfileAnnotation]; ok {
annotations[v1.IntegrationProfileAnnotation] = v
-
- //nolint:staticcheck
- if v, ok :=
kit.Annotations[v1.IntegrationProfileNamespaceAnnotation]; ok {
- annotations[v1.IntegrationProfileNamespaceAnnotation] =
v
- }
}
operatorID := defaults.OperatorID()
diff --git a/pkg/controller/pipe/monitor.go b/pkg/controller/pipe/monitor.go
index f35bc1fc2..26e513826 100644
--- a/pkg/controller/pipe/monitor.go
+++ b/pkg/controller/pipe/monitor.go
@@ -72,10 +72,6 @@ func (action *monitorAction) Handle(ctx context.Context,
pipe *v1.Pipe) (*v1.Pip
integrationProfileChanged := v1.GetIntegrationProfileAnnotation(pipe)
!= "" &&
(v1.GetIntegrationProfileAnnotation(pipe) !=
v1.GetIntegrationProfileAnnotation(&it))
- //nolint:staticcheck
- integrationProfileNamespaceChanged :=
v1.GetIntegrationProfileNamespaceAnnotation(pipe) != "" &&
- (v1.GetIntegrationProfileNamespaceAnnotation(pipe) !=
v1.GetIntegrationProfileNamespaceAnnotation(&it))
-
sameTraits, err := trait.IntegrationAndPipeSameTraits(action.client,
&it, pipe)
if err != nil {
return nil, err
@@ -96,12 +92,12 @@ func (action *monitorAction) Handle(ctx context.Context,
pipe *v1.Pipe) (*v1.Pip
semanticEquality := equality.Semantic.DeepDerivative(expected.Spec,
it.Spec)
- if !semanticEquality || operatorIDChanged || integrationProfileChanged
|| integrationProfileNamespaceChanged || !sameTraits {
+ if !semanticEquality || operatorIDChanged || integrationProfileChanged
|| !sameTraits {
action.L.Info(
"Pipe needs a rebuild",
"semantic-equality", !semanticEquality,
"operatorid-changed", operatorIDChanged,
- "integration-profile-changed",
integrationProfileChanged || integrationProfileNamespaceChanged,
+ "integration-profile-changed",
integrationProfileChanged,
"traits-changed", !sameTraits)
// Pipe has changed and needs rebuild
diff --git a/pkg/platform/env_platform.go b/pkg/platform/env_platform.go
index a12c100e8..5d4926cf5 100644
--- a/pkg/platform/env_platform.go
+++ b/pkg/platform/env_platform.go
@@ -24,6 +24,7 @@ import (
"slices"
"strconv"
"strings"
+ "sync"
"time"
v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
@@ -36,8 +37,11 @@ import (
// Used to check runtime architecture.
var operatorArch = runtime.GOARCH
-// SingletonPlatform is initialized once for performance reasons when the
application starts.
-var SingletonPlatform = getEnvPlatform()
+// singletonPlatform is initialized once for performance reasons when the
application starts.
+// The operator process should be in charge to initialize.
+var singletonPlatform Platform
+
+var logOnce sync.Map // map[string]*sync.Once
// Platform contains a series of configuration required during build and
packaging.
type Platform struct {
@@ -53,11 +57,25 @@ type Platform struct {
MaxRunningBuilds int32
}
-// getEnvPlatform is in charge to parse the environment variables of the
operator and return the Platform object.
-func getEnvPlatform() Platform {
+func (p *Platform) DeepCopy() *Platform {
+ if p == nil {
+ return nil
+ }
+
+ out := *p
+
+ out.BuildConfiguration = *p.BuildConfiguration.DeepCopy()
+ out.Registry = *p.Registry.DeepCopy()
+ out.Maven = *p.Maven.DeepCopy()
+
+ return &out
+}
+
+// InitPlatform is in charge to parse the environment variables of the
operator and initialize the environment Platform.
+func InitPlatform() {
registry := registry()
- return Platform{
+ singletonPlatform = Platform{
CatalogNamespace: GetOperatorNamespace(),
BuildRuntimeVersion: GetEnvOrDefault("BUILD_RUNTIME_VERSION",
defaults.DefaultRuntimeVersion),
BuildRuntimeProvider:
v1.RuntimeProvider(GetEnvOrDefault("BUILD_RUNTIME_PROVIDER",
defaults.DefaultRuntimeProvider)),
@@ -273,22 +291,25 @@ func registry() v1.RegistrySpec {
func repositories() []v1.Repository {
csvRepos := GetEnvOrDefault("MAVEN_REPOSITORIES", "")
- if csvRepos != "" {
- parts := strings.Split(csvRepos, ",")
+ if csvRepos == "" {
+ return nil
+ }
+ parts := strings.Split(csvRepos, ",")
- repositories := make([]v1.Repository, 0, len(parts))
- for _, repo := range parts {
- repo = strings.TrimSpace(repo)
- if repo == "" {
- continue
- }
- repositories = append(repositories,
maven.NewRepository(repo))
- }
+ return splitRepositories(parts)
+}
- return repositories
+func splitRepositories(repos []string) []v1.Repository {
+ repositories := make([]v1.Repository, 0, len(repos))
+ for _, repo := range repos {
+ repo = strings.TrimSpace(repo)
+ if repo == "" {
+ continue
+ }
+ repositories = append(repositories, maven.NewRepository(repo))
}
- return nil
+ return repositories
}
func mavenSpec() v1.MavenSpec {
@@ -378,8 +399,36 @@ func caSecrets() []corev1.SecretKeySelector {
return caSecrets
}
+// GetPlatform is in charge to return a Platform based on priority:
+// 1. From IntegrationPlatform
+// 2. From IntegrationProfile
+// 3. From default environment variable setting
+//
+//nolint:staticcheck
+func GetPlatform(itp *v1.IntegrationPlatform, itpr *v1.IntegrationProfile)
Platform {
+ if itp != nil {
+ return fromIntegrationPlatform(itp)
+ }
+
+ if itpr != nil {
+ return fromIntegrationProfile(itpr)
+ }
+
+ return getDefaultPlatform()
+}
+
//nolint:staticcheck
-func FromIntegrationPlatform(itp *v1.IntegrationPlatform) Platform {
+func fromIntegrationPlatform(itp *v1.IntegrationPlatform) Platform {
+ key := itp.Namespace + "/" + itp.Name
+ once, _ := logOnce.LoadOrStore(key, &sync.Once{})
+ o, ok := once.(*sync.Once)
+ if ok {
+ o.Do(func() {
+ log.Info("The operator detected the presence of a
DEPRECATED IntegrationPlatform resource (" +
+ itp.Namespace + "/" + itp.Name + "). You need
to remove it and replace any configuration with environment variables instead")
+ })
+ }
+
return Platform{
CatalogNamespace: itp.GetNamespace(),
BuildRuntimeVersion: itp.Status.Build.RuntimeVersion,
@@ -402,3 +451,52 @@ func IsMavenRepoAllowed(mavenRepo string) bool {
return slices.Contains(allowedRepos, mavenRepo)
}
+
+func fromIntegrationProfile(itpr *v1.IntegrationProfile) Platform {
+ // It uses as base the configuration coming from default. It adds on
top of that
+ // those configuration overridden.
+ basePlatform := singletonPlatform.DeepCopy()
+
+ if itpr.Spec.Build.RuntimeProvider != "" {
+ basePlatform.BuildRuntimeProvider =
itpr.Spec.Build.RuntimeProvider
+ }
+ if itpr.Spec.Build.RuntimeVersion != "" {
+ basePlatform.BuildRuntimeVersion =
itpr.Spec.Build.RuntimeVersion
+ }
+ if itpr.Spec.Build.Timeout != nil {
+ basePlatform.BuildTimeout =
itpr.Spec.Build.GetTimeout().Duration
+ }
+ if itpr.Spec.Build.BuildConfiguration.Strategy != "" {
+ basePlatform.BuildConfiguration.Strategy =
itpr.Spec.Build.BuildConfiguration.Strategy
+ }
+ if itpr.Spec.Build.BuildConfiguration.OrderStrategy != "" {
+ basePlatform.BuildConfiguration.OrderStrategy =
itpr.Spec.Build.BuildConfiguration.OrderStrategy
+ }
+ if itpr.Spec.Build.BuildConfiguration.ImagePlatforms != nil {
+ basePlatform.BuildConfiguration.ImagePlatforms =
itpr.Spec.Build.BuildConfiguration.ImagePlatforms
+ }
+ if itpr.Spec.Build.BaseImage != "" {
+ basePlatform.BuildBaseImage = itpr.Spec.Build.BaseImage
+ }
+ if itpr.Spec.Build.PublishStrategy != "" {
+ basePlatform.PublishStrategy = itpr.Spec.Build.PublishStrategy
+ }
+ if itpr.Spec.Build.Registry != nil {
+ basePlatform.Registry = *itpr.Spec.Build.Registry
+ }
+ if itpr.Spec.Build.Maven != nil {
+ basePlatform.Maven.MavenSpec = *itpr.Spec.Build.Maven
+ }
+ if itpr.Spec.Build.Repositories != nil {
+ basePlatform.Maven.Repositories =
splitRepositories(itpr.Spec.Build.Repositories)
+ }
+ if itpr.Spec.Build.MaxRunningBuilds > 0 {
+ basePlatform.MaxRunningBuilds = itpr.Spec.Build.MaxRunningBuilds
+ }
+
+ return *basePlatform
+}
+
+func getDefaultPlatform() Platform {
+ return singletonPlatform
+}
diff --git a/pkg/platform/env_platform_test.go
b/pkg/platform/env_platform_test.go
index 19ade81c8..a5a0e260d 100644
--- a/pkg/platform/env_platform_test.go
+++ b/pkg/platform/env_platform_test.go
@@ -29,7 +29,8 @@ import (
func TestGetEnvPlatform_Defaults(t *testing.T) {
// No environment variables set
- pl := getEnvPlatform() // reinitialize to get the value from env vars
+ InitPlatform()
+ pl := getDefaultPlatform()
assert.NotNil(t, pl)
assert.Equal(t, DefaultBuildStrategy, pl.BuildConfiguration.Strategy)
@@ -53,7 +54,8 @@ func TestGetEnvPlatform_WithEnv(t *testing.T) {
t.Setenv("MAVEN_SETTINGS", "configmap:my-settings@settings")
t.Setenv("MAVEN_SETTINGS_SECURITY", "secret:my-settings-sec@sec")
- p := getEnvPlatform() // reinitialize to get the value from env vars
+ InitPlatform()
+ p := getDefaultPlatform()
assert.Equal(t, "1.2.3", p.BuildRuntimeVersion)
assert.Equal(t, time.Duration(10)*time.Second, p.BuildTimeout)
@@ -258,3 +260,69 @@ func TestMavenRepoAllowedDefault(t *testing.T) {
assert.True(t, IsMavenRepoAllowed(maven.DefaultMavenRepositories))
assert.False(t, IsMavenRepoAllowed("repo3"))
}
+
+func TestFromIntegrationProfile_Overrides(t *testing.T) {
+ original := singletonPlatform
+ t.Cleanup(func() {
+ singletonPlatform = original
+ })
+
+ singletonPlatform = Platform{
+ BuildRuntimeVersion: "1.20",
+ BuildTimeout: 5 * time.Minute,
+ BuildConfiguration: v1.BuildConfiguration{
+ Strategy: "default-strategy",
+ OrderStrategy: "default-order",
+ },
+ BuildBaseImage: "default-image",
+ PublishStrategy: "default-publish",
+ Registry: v1.RegistrySpec{
+ Address: "default.registry",
+ },
+ Maven: v1.MavenBuildSpec{
+ MavenSpec: v1.MavenSpec{},
+ Repositories: []v1.Repository{},
+ },
+ MaxRunningBuilds: 3,
+ }
+
+ itpr := &v1.IntegrationProfile{
+ Spec: v1.IntegrationProfileSpec{
+ Build: v1.IntegrationProfileBuildSpec{
+ RuntimeProvider: v1.RuntimeProviderPlainQuarkus,
+ RuntimeVersion: "1.21",
+ BaseImage: "custom-image",
+ PublishStrategy:
v1.IntegrationPlatformBuildPublishStrategyJib,
+ Registry: &v1.RegistrySpec{
+ Address: "custom.registry",
+ Secret: "custom-secret",
+ Organization: "custom-org",
+ },
+ Maven: &v1.MavenSpec{
+ Settings: v1.ValueSource{},
+ },
+ Repositories:
[]string{"https://repo1.example.com", "https://repo2.example.com"},
+ MaxRunningBuilds: 10,
+ },
+ },
+ }
+
+ got := fromIntegrationProfile(itpr)
+
+ assert.Equal(t, v1.RuntimeProviderPlainQuarkus,
got.BuildRuntimeProvider)
+ assert.Equal(t, "1.21", got.BuildRuntimeVersion)
+ assert.Equal(t, "custom-image", got.BuildBaseImage)
+ assert.Equal(t, v1.IntegrationPlatformBuildPublishStrategyJib,
got.PublishStrategy)
+ assert.Equal(t, "custom.registry", got.Registry.Address)
+ assert.Equal(t, "custom-secret", got.Registry.Secret)
+ assert.Equal(t, "custom-org", got.Registry.Organization)
+ assert.Equal(t, int32(10), got.MaxRunningBuilds)
+ assert.Equal(t,
+ itpr.Spec.Build.Maven,
+ &got.Maven.MavenSpec,
+ )
+ assert.Equal(t,
+ splitRepositories(itpr.Spec.Build.Repositories),
+ got.Maven.Repositories,
+ )
+}
diff --git a/pkg/platform/operator.go b/pkg/platform/operator.go
index 16aa0c863..abe3432fa 100644
--- a/pkg/platform/operator.go
+++ b/pkg/platform/operator.go
@@ -232,11 +232,6 @@ func (f FilteringFuncs[T]) Update(e
event.TypedUpdateEvent[T]) bool {
// Always force reconciliation when the object gets attached to
a new integration profile
return true
}
- //nolint:staticcheck
- if camelv1.GetIntegrationProfileNamespaceAnnotation(e.ObjectOld) !=
camelv1.GetIntegrationProfileNamespaceAnnotation(e.ObjectNew) {
- // Always force reconciliation when the object gets attached to
a new integration profile
- return true
- }
if f.UpdateFunc != nil {
return f.UpdateFunc(e)
}
diff --git a/pkg/platform/profile.go b/pkg/platform/profile.go
index e5e6763ed..e6ac23f5e 100644
--- a/pkg/platform/profile.go
+++ b/pkg/platform/profile.go
@@ -37,24 +37,11 @@ func ApplyIntegrationProfile(ctx context.Context, c
k8sclient.Reader, o k8sclien
return profile, nil
}
-// findIntegrationProfile finds profile from given resource annotations and
resolves the profile in given resource namespace or operator namespace as a
fallback option.
+// findIntegrationProfile finds profile from given resource annotations
+// and resolves the profile in given resource namespace.
func findIntegrationProfile(ctx context.Context, c k8sclient.Reader, o
k8sclient.Object) (*v1.IntegrationProfile, error) {
if profileName := v1.GetIntegrationProfileAnnotation(o); profileName !=
"" {
- //nolint:staticcheck
- namespace := v1.GetIntegrationProfileNamespaceAnnotation(o)
- if namespace == "" {
- namespace = o.GetNamespace()
- }
-
- profile, err := kubernetes.GetIntegrationProfile(ctx, c,
profileName, namespace)
- if err != nil && k8serrors.IsNotFound(err) {
- operatorNamespace := GetOperatorNamespace()
- if operatorNamespace != "" && operatorNamespace !=
namespace {
- profile, err =
kubernetes.GetIntegrationProfile(ctx, c, profileName, operatorNamespace)
- }
- }
-
- return profile, err
+ return kubernetes.GetIntegrationProfile(ctx, c, profileName,
o.GetNamespace())
}
return nil, nil
diff --git a/pkg/platform/profile_test.go b/pkg/platform/profile_test.go
index 15a8a03e3..6fba44146 100644
--- a/pkg/platform/profile_test.go
+++ b/pkg/platform/profile_test.go
@@ -57,65 +57,3 @@ func TestFindIntegrationProfile(t *testing.T) {
require.NoError(t, err)
assert.NotNil(t, found)
}
-
-func TestFindIntegrationProfileWithNamespace(t *testing.T) {
- profile := v1.IntegrationProfile{
- ObjectMeta: metav1.ObjectMeta{
- Name: "custom",
- Namespace: "other",
- },
- }
-
- c, err := internal.NewFakeClient(&profile)
- require.NoError(t, err)
-
- integration := v1.Integration{
- ObjectMeta: metav1.ObjectMeta{
- Name: "test",
- Namespace: "ns",
- Annotations: map[string]string{
- v1.IntegrationProfileAnnotation: "custom",
- //nolint:staticcheck
- v1.IntegrationProfileNamespaceAnnotation:
"other",
- },
- },
- Status: v1.IntegrationStatus{
- Phase: v1.IntegrationPhaseRunning,
- },
- }
-
- found, err := findIntegrationProfile(context.TODO(), c, &integration)
- require.NoError(t, err)
- assert.NotNil(t, found)
-}
-
-func TestFindIntegrationProfileInOperatorNamespace(t *testing.T) {
- profile := v1.IntegrationProfile{
- ObjectMeta: metav1.ObjectMeta{
- Name: "custom",
- Namespace: "operator-namespace",
- },
- }
-
- c, err := internal.NewFakeClient(&profile)
- require.NoError(t, err)
-
- t.Setenv(operatorNamespaceEnvVariable, "operator-namespace")
-
- integration := v1.Integration{
- ObjectMeta: metav1.ObjectMeta{
- Name: "test",
- Namespace: "ns",
- Annotations: map[string]string{
- v1.IntegrationProfileAnnotation: "custom",
- },
- },
- Status: v1.IntegrationStatus{
- Phase: v1.IntegrationPhaseRunning,
- },
- }
-
- found, err := findIntegrationProfile(context.TODO(), c, &integration)
- require.NoError(t, err)
- assert.NotNil(t, found)
-}
diff --git
a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
index 46a3dd31c..fa5b6f01c 100644
--- a/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
+++ b/pkg/resources/config/crd/bases/camel.apache.org_integrationprofiles.yaml
@@ -67,14 +67,27 @@ spec:
build:
description: specify how to build the
Integration/IntegrationKits
properties:
+ annotations:
+ additionalProperties:
+ type: string
+ description: Annotation to use for the builder pod. Only
used
+ for `pod` 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 software
type: string
+ 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
maven:
- description: Maven configuration used to build the
Camel/Camel-Quarkus
- applications
+ description: Maven configuration used to build the Camel
applications
properties:
caSecrets:
description: |-
@@ -312,6 +325,40 @@ spec:
x-kubernetes-map-type: atomic
type: object
type: object
+ maxRunningBuilds:
+ description: the maximum amount of parallel running
pipelines
+ started by this operator instance
+ format: int32
+ type: integer
+ nodeSelector:
+ additionalProperties:
+ type: string
+ description: The node selector for the builder pod. Only
used
+ for `pod` strategy
+ type: object
+ operatorNamespace:
+ description: |-
+ The namespace where to run the builder Pod (must be the
same of the operator in charge of this Build reconciliation).
+
+ Deprecated: no longer in use.
+ type: string
+ orderStrategy:
+ description: the build order strategy to adopt
+ enum:
+ - dependencies
+ - fifo
+ - sequential
+ type: string
+ platforms:
+ description: The list of platforms used in order to build
a container
+ image.
+ items:
+ type: string
+ type: array
+ 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
@@ -333,18 +380,38 @@ spec:
description: the secret where credentials are stored
type: string
type: object
+ repositories:
+ description: Maven repositories used to build the Camel
applications
+ items:
+ type: string
+ type: array
+ 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
runtimeProvider:
- description: the runtime used. Likely Camel Quarkus (we
used to
- have main runtime which has been discontinued since
version
- 1.5)
+ description: the runtime provider to use. Likely Camel
Quarkus.
type: string
runtimeVersion:
- description: the Camel K Runtime dependency version
+ description: the runtime dependency version to use.
+ type: string
+ strategy:
+ description: the strategy to adopt
+ enum:
+ - routine
+ - pod
type: string
timeout:
description: how much time to wait before time out the
pipeline
process
type: string
+ toolImage:
+ description: The container image to be used to run the
build.
+ type: string
type: object
dependencies:
description: a list of dependencies needed by the application
@@ -2444,14 +2511,27 @@ spec:
build:
description: specify how to build the
Integration/IntegrationKits
properties:
+ annotations:
+ additionalProperties:
+ type: string
+ description: Annotation to use for the builder pod. Only
used
+ for `pod` 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 software
type: string
+ 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
maven:
- description: Maven configuration used to build the
Camel/Camel-Quarkus
- applications
+ description: Maven configuration used to build the Camel
applications
properties:
caSecrets:
description: |-
@@ -2689,6 +2769,40 @@ spec:
x-kubernetes-map-type: atomic
type: object
type: object
+ maxRunningBuilds:
+ description: the maximum amount of parallel running
pipelines
+ started by this operator instance
+ format: int32
+ type: integer
+ nodeSelector:
+ additionalProperties:
+ type: string
+ description: The node selector for the builder pod. Only
used
+ for `pod` strategy
+ type: object
+ operatorNamespace:
+ description: |-
+ The namespace where to run the builder Pod (must be the
same of the operator in charge of this Build reconciliation).
+
+ Deprecated: no longer in use.
+ type: string
+ orderStrategy:
+ description: the build order strategy to adopt
+ enum:
+ - dependencies
+ - fifo
+ - sequential
+ type: string
+ platforms:
+ description: The list of platforms used in order to build
a container
+ image.
+ items:
+ type: string
+ type: array
+ 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
@@ -2710,25 +2824,47 @@ spec:
description: the secret where credentials are stored
type: string
type: object
+ repositories:
+ description: Maven repositories used to build the Camel
applications
+ items:
+ type: string
+ type: array
+ 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
runtimeProvider:
- description: the runtime used. Likely Camel Quarkus (we
used to
- have main runtime which has been discontinued since
version
- 1.5)
+ description: the runtime provider to use. Likely Camel
Quarkus.
type: string
runtimeVersion:
- description: the Camel K Runtime dependency version
+ description: the runtime dependency version to use.
+ type: string
+ strategy:
+ description: the strategy to adopt
+ enum:
+ - routine
+ - pod
type: string
timeout:
description: how much time to wait before time out the
pipeline
process
type: string
+ toolImage:
+ description: The container image to be used to run the
build.
+ type: string
type: object
conditions:
description: which are the conditions met (particularly useful
when
in ERROR phase)
items:
- description: IntegrationProfileCondition describes the state
of
- a resource at a certain point.
+ description: |-
+ DeprecatedIntegrationProfileCondition describes the state
of a resource at a certain point.
+
+ Deprecated: no longer in use.
properties:
lastTransitionTime:
description: Last time the condition transitioned from
one status
diff --git a/pkg/trait/quarkus.go b/pkg/trait/quarkus.go
index bb886b1e1..45f581bdc 100644
--- a/pkg/trait/quarkus.go
+++ b/pkg/trait/quarkus.go
@@ -304,15 +304,6 @@ func (t *quarkusTrait) newIntegrationKit(e *Environment,
packageType quarkusPack
if v, ok := integration.Annotations[v1.IntegrationProfileAnnotation];
ok {
v1.SetAnnotation(&kit.ObjectMeta,
v1.IntegrationProfileAnnotation, v)
-
- //nolint:staticcheck
- if v, ok :=
e.Integration.Annotations[v1.IntegrationProfileNamespaceAnnotation]; ok {
- v1.SetAnnotation(&kit.ObjectMeta,
v1.IntegrationProfileNamespaceAnnotation, v)
- } else {
- // set integration profile namespace to the integration
namespace.
- // this is because the kit may live in another
namespace and needs to resolve the integration profile from the integration
namespace.
- v1.SetAnnotation(&kit.ObjectMeta,
v1.IntegrationProfileNamespaceAnnotation, e.Integration.Namespace)
- }
}
operatorID := defaults.OperatorID()
if operatorID != "" {
diff --git a/pkg/trait/trait.go b/pkg/trait/trait.go
index c5d5aadd3..b2ce2fac9 100644
--- a/pkg/trait/trait.go
+++ b/pkg/trait/trait.go
@@ -21,7 +21,6 @@ import (
"context"
"errors"
"fmt"
- "sync"
corev1 "k8s.io/api/core/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
@@ -36,8 +35,6 @@ import (
ctrl "sigs.k8s.io/controller-runtime/pkg/client"
)
-var logOnce sync.Once
-
func Apply(ctx context.Context, c client.Client, integration *v1.Integration,
kit *v1.IntegrationKit) (*Environment, error) {
var ilog log.Logger
switch {
@@ -138,15 +135,7 @@ func newEnvironment(ctx context.Context, c client.Client,
integration *v1.Integr
}
}
- envPlatform := platform.SingletonPlatform
- if pl != nil {
- // Fallback to any existing IntegrationPlatform. This is
deprecated though.
- envPlatform = platform.FromIntegrationPlatform(pl)
- logOnce.Do(func() {
- log.Info("The operator detected the presence of a
DEPRECATED IntegrationPlatform resource (" +
- pl.Namespace + "/" + pl.Name + "). You need to
remove it and replace any configuration with environment variables instead")
- })
- }
+ envPlatform := platform.GetPlatform(pl, ipr)
//
// kit can still be nil if integration kit is yet
diff --git a/pkg/trait/trait_test.go b/pkg/trait/trait_test.go
index 61769a2ef..67605e381 100644
--- a/pkg/trait/trait_test.go
+++ b/pkg/trait/trait_test.go
@@ -308,7 +308,8 @@ func testDefaultIntegrationPhaseTraitsSetting(t *testing.T,
phase v1.Integration
err = yaml.Unmarshal(camelCatalogData, &cat)
require.NoError(t, err)
cat.Namespace = "default"
- platform.SingletonPlatform.CatalogNamespace = cat.Namespace
+ t.Setenv("NAMESPACE", cat.Namespace)
+ platform.InitPlatform()
client, err := internal.NewFakeClient(&cat)
require.NoError(t, err)
@@ -380,7 +381,8 @@ func TestAutoInferredServiceTraitsDoNotLeakIntoStatus(t
*testing.T) {
err = yaml.Unmarshal(camelCatalogData, &cat)
require.NoError(t, err)
cat.Namespace = "default"
- platform.SingletonPlatform.CatalogNamespace = cat.Namespace
+ t.Setenv("NAMESPACE", cat.Namespace)
+ platform.InitPlatform()
client, err := internal.NewFakeClient(&cat)
require.NoError(t, err)
@@ -428,7 +430,8 @@ func TestUserSpecifiedTraitValuesStillAppearInStatus(t
*testing.T) {
err = yaml.Unmarshal(camelCatalogData, &cat)
require.NoError(t, err)
cat.Namespace = "default"
- platform.SingletonPlatform.CatalogNamespace = cat.Namespace
+ t.Setenv("NAMESPACE", cat.Namespace)
+ platform.InitPlatform()
client, err := internal.NewFakeClient(&cat)
require.NoError(t, err)
@@ -491,7 +494,8 @@ func TestIntegrationTraitsSetting(t *testing.T) {
err = yaml.Unmarshal(camelCatalogData, &cat)
require.NoError(t, err)
cat.Namespace = "default"
- platform.SingletonPlatform.CatalogNamespace = cat.Namespace
+ t.Setenv("NAMESPACE", cat.Namespace)
+ platform.InitPlatform()
client, err := internal.NewFakeClient(&cat)
require.NoError(t, err)
@@ -514,3 +518,95 @@ func TestIntegrationTraitsSetting(t *testing.T) {
},
}, env.Integration.Status.Traits)
}
+
+func TestApplyEnvPlatformFromDefaultEnvVars(t *testing.T) {
+ it := &v1.Integration{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "my-it",
+ Namespace: "ns",
+ },
+ Spec: v1.IntegrationSpec{
+ Sources: []v1.SourceSpec{
+ {
+ DataSpec: v1.DataSpec{
+ Name: "file.java",
+ Content:
`from("timer:test").to("log:info")`,
+ },
+ Language: v1.LanguageJavaSource,
+ },
+ },
+ },
+ }
+ // Load the default catalog
+ camelCatalogData, err :=
resources.Resource(fmt.Sprintf("/resources/camel-catalog-%s.yaml",
defaults.CamelKRuntimeCatalogVersion))
+ require.NoError(t, err)
+ var cat v1.CamelCatalog
+ err = yaml.Unmarshal(camelCatalogData, &cat)
+ require.NoError(t, err)
+ cat.Namespace = "default"
+ t.Setenv("NAMESPACE", cat.Namespace)
+ t.Setenv("REGISTRY_ADDRESS", "my-registry.io")
+ platform.InitPlatform()
+
+ client, err := internal.NewFakeClient(&cat)
+ require.NoError(t, err)
+ env, err := Apply(context.Background(), client, it, nil)
+ require.NoError(t, err)
+ assert.NotEmpty(t, env.Platform)
+
+ assert.Equal(t, "my-registry.io", env.Platform.Registry.Address)
+}
+
+func TestApplyEnvPlatformFromIntegrationProfile(t *testing.T) {
+ it := &v1.Integration{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "my-it",
+ Namespace: "ns",
+ Annotations: map[string]string{
+ "camel.apache.org/integration-profile.id":
"my-profile",
+ },
+ },
+ Spec: v1.IntegrationSpec{
+ Sources: []v1.SourceSpec{
+ {
+ DataSpec: v1.DataSpec{
+ Name: "file.java",
+ Content:
`from("timer:test").to("log:info")`,
+ },
+ Language: v1.LanguageJavaSource,
+ },
+ },
+ },
+ }
+ ipr := &v1.IntegrationProfile{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "my-profile",
+ Namespace: "ns",
+ },
+ Spec: v1.IntegrationProfileSpec{
+ Build: v1.IntegrationProfileBuildSpec{
+ Registry: &v1.RegistrySpec{
+ Address: "profile-overridden.io",
+ },
+ },
+ },
+ }
+ // Load the default catalog
+ camelCatalogData, err :=
resources.Resource(fmt.Sprintf("/resources/camel-catalog-%s.yaml",
defaults.CamelKRuntimeCatalogVersion))
+ require.NoError(t, err)
+ var cat v1.CamelCatalog
+ err = yaml.Unmarshal(camelCatalogData, &cat)
+ require.NoError(t, err)
+ cat.Namespace = "default"
+ t.Setenv("NAMESPACE", cat.Namespace)
+ t.Setenv("REGISTRY_ADDRESS", "my-registry.io")
+ platform.InitPlatform()
+
+ client, err := internal.NewFakeClient(&cat, ipr)
+ require.NoError(t, err)
+ env, err := Apply(context.Background(), client, it, nil)
+ require.NoError(t, err)
+ assert.NotEmpty(t, env.Platform)
+
+ assert.Equal(t, "profile-overridden.io", env.Platform.Registry.Address)
+}
diff --git a/pkg/util/camel/camel_runtime_test.go
b/pkg/util/camel/camel_runtime_test.go
index 581d4cc61..c1461cacd 100644
--- a/pkg/util/camel/camel_runtime_test.go
+++ b/pkg/util/camel/camel_runtime_test.go
@@ -45,12 +45,14 @@ func TestCreateCatalog(t *testing.T) {
if strings.Contains(defaults.CamelKRuntimeCatalogVersion, "SNAPSHOT") {
maven.DefaultMavenRepositories +=
",https://repository.apache.org/content/repositories/snapshots-group@snapshots@id=apache-snapshots"
}
+ platform.InitPlatform()
+ pl := platform.GetPlatform(nil, nil)
catalog, err := CreateCatalog(
context.TODO(),
c,
"",
- platform.SingletonPlatform.Maven.MavenSpec,
- platform.SingletonPlatform.BuildTimeout,
+ pl.Maven.MavenSpec,
+ pl.BuildTimeout,
v1.RuntimeSpec{Provider: v1.RuntimeProviderQuarkus, Version:
defaults.CamelKRuntimeCatalogVersion},
nil,
"",
diff --git a/pkg/util/digest/digest.go b/pkg/util/digest/digest.go
index 784964259..8ee6b7cf9 100644
--- a/pkg/util/digest/digest.go
+++ b/pkg/util/digest/digest.go
@@ -61,10 +61,6 @@ func ComputeForIntegration(integration *v1.Integration,
configmapVersions []stri
if _, err :=
hash.Write([]byte(v1.GetIntegrationProfileAnnotation(integration))); err != nil
{
return "", err
}
- //nolint:staticcheck
- if _, err :=
hash.Write([]byte(v1.GetIntegrationProfileNamespaceAnnotation(integration)));
err != nil {
- return "", err
- }
// Integration Kit is relevant
if integration.Spec.IntegrationKit != nil {