IntegrationPlatformConditionType –
(Appears on: IntegrationPlatformKameletSpec)
IntegrationPlatformKameletRepositorySpec –
+KameletRepositorySpec –
repositories - -[]IntegrationPlatformKameletRepositorySpec + +[]KameletRepositorySpec |
diff --git a/docs/modules/traits/pages/platform.adoc b/docs/modules/traits/pages/platform.adoc
index 7ac67efa4c..147c201bf5 100755
--- a/docs/modules/traits/pages/platform.adoc
+++ b/docs/modules/traits/pages/platform.adoc
@@ -2,10 +2,7 @@
// Start of autogenerated code - DO NOT EDIT! (description)
The platform trait is a base trait that is used to assign an integration platform to an integration.
-
-In case the platform is missing, the trait is allowed to create a default platform.
-This feature is especially useful in contexts where there's no need to provide a custom configuration for the platform
-(e.g. on OpenShift the default settings work, since there's an embedded container image registry).
+In case the platform is missing, the trait puts the integration into a waiting state.
This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.
@@ -19,7 +16,7 @@ NOTE: The platform trait is a *platform trait* and cannot be disabled by the use
Trait properties can be specified when running any integration with the CLI:
[source,console]
----
-$ kamel run --trait platform.[key]=[value] --trait platform.[key2]=[value2] integration.groovy
+$ kamel run --trait platform.[key]=[value] integration.groovy
----
The following configuration options are available:
@@ -31,18 +28,6 @@ The following configuration options are available:
| bool
| Deprecated: no longer in use.
-| platform.create-default
-| bool
-| To create a default (empty) platform when the platform is missing.
-
-| platform.global
-| bool
-| Indicates if the platform should be created globally in the case of global operator (default true).
-
-| platform.auto
-| bool
-| To automatically detect from the environment if a default platform can be created (it will be created on OpenShift only).
-
|===
// End of autogenerated code - DO NOT EDIT! (configuration)
diff --git a/e2e/common/misc/platformless_run_test.go b/e2e/common/misc/platformless_run_test.go
index d4b0d0bd69..46b66c0447 100644
--- a/e2e/common/misc/platformless_run_test.go
+++ b/e2e/common/misc/platformless_run_test.go
@@ -43,7 +43,7 @@ func TestPlatformlessRun(t *testing.T) {
ocp, err := openshift.IsOpenShift(TestClient())
assert.Nil(t, err)
if needsExternalRepo || !ocp {
- t.Skip("This test is for OpenShift only and cannot work when a custom platform configuration is needed")
+ t.Skip("This test is for OpenShift only and cannot work when a custom integration platform is needed")
return
}
if os.Getenv("CAMEL_K_FORCE_GLOBAL_TEST") == "true" {
diff --git a/e2e/commonwithcustominstall/integration_profile_test.go b/e2e/commonwithcustominstall/integration_profile_test.go
new file mode 100644
index 0000000000..e5d99561d4
--- /dev/null
+++ b/e2e/commonwithcustominstall/integration_profile_test.go
@@ -0,0 +1,213 @@
+//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 commonwithcustominstall
+
+import (
+ "testing"
+
+ "github.com/apache/camel-k/v2/pkg/util/defaults"
+ . "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"
+)
+
+func TestIntegrationProfile(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ operatorID := "camel-k-integration-profile"
+ Expect(KamelInstallWithID(operatorID, ns, "--global", "--force").Execute()).To(Succeed())
+ Eventually(PlatformPhase(ns), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
+ integrationProfile := v1.NewIntegrationProfile(ns, "ipr-global")
+ integrationProfile.SetOperatorID(operatorID)
+ integrationProfile.Spec.Traits.Container = &traitv1.ContainerTrait{
+ Name: "ck-integration-global",
+ LimitCPU: "0.2",
+ }
+
+ Expect(CreateIntegrationProfile(&integrationProfile)).To(Succeed())
+ Eventually(SelectedIntegrationProfilePhase(ns, "ipr-global"), TestTimeoutMedium).Should(Equal(v1.IntegrationProfilePhaseReady))
+
+ WithNewTestNamespace(t, func(ns1 string) {
+ integrationProfile := v1.NewIntegrationProfile(ns1, "ipr-local")
+ integrationProfile.SetOperatorID(operatorID)
+ integrationProfile.Spec.Traits.Container = &traitv1.ContainerTrait{
+ LimitCPU: "0.1",
+ }
+ Expect(CreateIntegrationProfile(&integrationProfile)).To(Succeed())
+ Eventually(SelectedIntegrationProfilePhase(ns1, "ipr-local"), TestTimeoutMedium).Should(Equal(v1.IntegrationProfilePhaseReady))
+
+ t.Run("Run integration with global integration profile", func(t *testing.T) {
+ Expect(KamelRunWithID(operatorID, ns1, "--name", "limited", "--integration-profile", "ipr-global", "files/yaml.yaml").Execute()).To(Succeed())
+
+ Eventually(IntegrationPod(ns1, "limited"), TestTimeoutMedium).Should(Not(BeNil()))
+ Eventually(IntegrationPodHas(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())
+ Eventually(IntegrationPodHas(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())
+ Expect(Kamel("delete", "limited", "-n", ns1).Execute()).To(Succeed())
+ })
+
+ t.Run("Run integration with namespace local integration profile", func(t *testing.T) {
+ Expect(KamelRunWithID(operatorID, ns1, "--name", "limited", "--integration-profile", "ipr-local", "files/yaml.yaml").Execute()).To(Succeed())
+
+ Eventually(IntegrationPod(ns1, "limited"), TestTimeoutMedium).Should(Not(BeNil()))
+ Eventually(IntegrationPodHas(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())
+
+ Eventually(IntegrationPodHas(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())
+ Expect(Kamel("delete", "limited", "-n", ns1).Execute()).To(Succeed())
+ })
+
+ t.Run("Run integration without integration profile", func(t *testing.T) {
+ Expect(KamelRunWithID(operatorID, ns1, "--name", "normal", "files/yaml.yaml").Execute()).To(Succeed())
+ Eventually(IntegrationPod(ns1, "normal"), TestTimeoutShort).Should(Not(BeNil()))
+ Eventually(IntegrationPodHas(ns1, "normal", 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.IsZero()
+ }), TestTimeoutShort).Should(BeTrue())
+ })
+
+ // Clean up
+ Expect(Kamel("delete", "--all", "-n", ns1).Execute()).To(Succeed())
+ })
+ })
+}
+
+func TestIntegrationProfileInfluencesKit(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ operatorID := "camel-k-ipr-kit"
+ Expect(KamelInstallWithID(operatorID, ns, "--global", "--force").Execute()).To(Succeed())
+ Eventually(PlatformPhase(ns), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
+ integrationProfile := v1.NewIntegrationProfile(ns, "ipr-global")
+ integrationProfile.SetOperatorID(operatorID)
+ integrationProfile.Spec.Traits.Builder = &traitv1.BuilderTrait{
+ Properties: []string{"b1=foo"},
+ }
+
+ Expect(CreateIntegrationProfile(&integrationProfile)).To(Succeed())
+ Eventually(SelectedIntegrationProfilePhase(ns, "ipr-global"), TestTimeoutMedium).Should(Equal(v1.IntegrationProfilePhaseReady))
+
+ Expect(KamelRunWithID(operatorID, ns, "--name", "normal", "files/yaml.yaml").Execute()).To(Succeed())
+ Eventually(IntegrationPod(ns, "normal"), TestTimeoutMedium).Should(Not(BeNil()))
+ Eventually(IntegrationPodPhase(ns, "normal"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ Eventually(IntegrationConditionStatus(ns, "normal", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
+ Eventually(IntegrationLogs(ns, "normal"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
+ // Verify that a new kit has been built based on the default base image
+ integrationKitName := IntegrationKit(ns, "normal")()
+ Eventually(Kit(ns, integrationKitName)().Status.BaseImage).Should(Equal(defaults.BaseImage()))
+ Eventually(Kit(ns, integrationKitName)().Status.RootImage).Should(Equal(defaults.BaseImage()))
+
+ Expect(KamelRunWithID(operatorID, ns, "--name", "simple", "--integration-profile", "ipr-global", "files/yaml.yaml").Execute()).To(Succeed())
+
+ Eventually(IntegrationPod(ns, "simple"), TestTimeoutMedium).Should(Not(BeNil()))
+ Eventually(IntegrationPodPhase(ns, "simple"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ Eventually(IntegrationConditionStatus(ns, "simple", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
+ Eventually(IntegrationLogs(ns, "simple"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
+
+ // Verify that a new kit has been built based on the previous kit
+ integrationKitNameWithProfile := IntegrationKit(ns, "simple")()
+ Eventually(integrationKitNameWithProfile).ShouldNot(Equal(integrationKitName))
+ Eventually(Kit(ns, integrationKitNameWithProfile)().Status.BaseImage).Should(ContainSubstring(integrationKitName))
+ Eventually(Kit(ns, integrationKitNameWithProfile)().Status.RootImage).Should(Equal(defaults.BaseImage()))
+
+ // Clean up
+ Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
+ })
+}
+
+func TestPropagateIntegrationProfileChanges(t *testing.T) {
+ WithNewTestNamespace(t, func(ns string) {
+ operatorID := "camel-k-ipr-changes"
+ Expect(KamelInstallWithID(operatorID, ns, "--global", "--force").Execute()).To(Succeed())
+ Eventually(PlatformPhase(ns), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
+ 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",
+ }
+
+ Expect(CreateIntegrationProfile(&integrationProfile)).To(Succeed())
+ Eventually(SelectedIntegrationProfilePhase(ns, "debug-profile"), TestTimeoutMedium).Should(Equal(v1.IntegrationProfilePhaseReady))
+
+ Expect(KamelRunWithID(operatorID, ns, "--name", "simple", "--integration-profile", "debug-profile", "files/yaml.yaml").Execute()).To(Succeed())
+
+ Eventually(IntegrationPod(ns, "simple"), TestTimeoutMedium).Should(Not(BeNil()))
+ Eventually(IntegrationPodHas(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())
+
+ Expect(UpdateIntegrationProfile(ns, func(ipr *v1.IntegrationProfile) {
+ ipr.Spec.Traits.Container = &traitv1.ContainerTrait{
+ Name: "ck-ipr-new",
+ }
+ })).To(Succeed())
+
+ Eventually(IntegrationPodHas(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())
+
+ // Clean up
+ Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
+ })
+}
diff --git a/e2e/commonwithcustominstall/secondary_platform_test.go b/e2e/commonwithcustominstall/secondary_platform_test.go
deleted file mode 100644
index 6cabfb3053..0000000000
--- a/e2e/commonwithcustominstall/secondary_platform_test.go
+++ /dev/null
@@ -1,76 +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 commonwithcustominstall
-
-import (
- "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"
-)
-
-func TestSecondaryPlatform(t *testing.T) {
- WithNewTestNamespace(t, func(ns string) {
- operatorID := "camel-k-platform-secondary"
- Expect(KamelInstallWithID(operatorID, ns).Execute()).To(Succeed())
- Eventually(PlatformPhase(ns), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
-
- Expect(ConfigureSecondaryPlatformWith(ns, func(p *v1.IntegrationPlatform) {
- p.Name = "secondary"
- p.Spec.Traits.Container = &traitv1.ContainerTrait{
- LimitCPU: "0.1",
- }
- })).To(Succeed())
- Eventually(SelectedPlatformPhase(ns, "secondary"), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
-
- Expect(KamelRunWithID(operatorID, ns, "--name", "limited", "--annotation", "camel.apache.org/platform.id=secondary", "files/yaml.yaml").Execute()).To(Succeed())
-
- Eventually(IntegrationPod(ns, "limited"), TestTimeoutMedium).Should(Not(BeNil()))
- Eventually(IntegrationPodHas(ns, "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())
- Expect(Kamel("delete", "limited", "-n", ns).Execute()).To(Succeed())
-
- Expect(KamelRunWithID(operatorID, ns, "--name", "normal", "files/yaml.yaml").Execute()).To(Succeed())
- Eventually(IntegrationPod(ns, "normal"), TestTimeoutShort).Should(Not(BeNil()))
- Eventually(IntegrationPodHas(ns, "normal", 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.IsZero()
- }), TestTimeoutShort).Should(BeTrue())
-
- // Clean up
- Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
- })
-}
diff --git a/e2e/knative/knative_platform_test.go b/e2e/knative/knative_platform_test.go
index f221d02f6e..90b2d6704a 100644
--- a/e2e/knative/knative_platform_test.go
+++ b/e2e/knative/knative_platform_test.go
@@ -60,7 +60,7 @@ func TestKnativePlatformDetection(t *testing.T) {
Expect(KamelRunWithID(operatorID, ns, "files/yaml.yaml", "--profile", string(cluster)).Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
Eventually(IntegrationLogs(ns, "yaml"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
- Eventually(IntegrationProfile(ns, "yaml"), TestTimeoutShort).Should(Equal(v1.TraitProfile(string(cluster))))
+ Eventually(IntegrationTraitProfile(ns, "yaml"), TestTimeoutShort).Should(Equal(v1.TraitProfile(string(cluster))))
// Change something in the integration to produce a redeploy
Expect(UpdateIntegration(ns, "yaml", func(it *v1.Integration) {
it.Spec.Profile = ""
@@ -77,7 +77,7 @@ func TestKnativePlatformDetection(t *testing.T) {
Eventually(IntegrationPhase(ns, "yaml")).Should(Equal(v1.IntegrationPhaseRunning))
Eventually(IntegrationLogs(ns, "yaml"), TestTimeoutShort).Should(ContainSubstring("Magicstring!!!"))
// It should keep the old profile saved in status
- Eventually(IntegrationProfile(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.TraitProfile(cluster)))
+ Eventually(IntegrationTraitProfile(ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.TraitProfile(cluster)))
Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
})
@@ -85,7 +85,7 @@ func TestKnativePlatformDetection(t *testing.T) {
t.Run("run yaml on automatic profile", func(t *testing.T) {
Expect(KamelRunWithID(operatorID, ns, "files/yaml.yaml").Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "yaml"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
- Eventually(IntegrationProfile(ns, "yaml"), TestTimeoutShort).Should(Equal(v1.TraitProfileKnative))
+ Eventually(IntegrationTraitProfile(ns, "yaml"), TestTimeoutShort).Should(Equal(v1.TraitProfileKnative))
Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
})
})
diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go
index 3e2faf2c7a..ce128e0f52 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -1053,7 +1053,7 @@ func IntegrationVersion(ns string, name string) func() string {
}
}
-func IntegrationProfile(ns string, name string) func() v1.TraitProfile {
+func IntegrationTraitProfile(ns string, name string) func() v1.TraitProfile {
return func() v1.TraitProfile {
it := Integration(ns, name)()
if it == nil {
@@ -1899,21 +1899,7 @@ func Platform(ns string) func() *v1.IntegrationPlatform {
return nil
}
if len(lst.Items) > 1 {
- var pl *v1.IntegrationPlatform
- for _, p := range lst.Items {
- p := p
- if platform.IsSecondary(&p) {
- continue
- }
- if pl != nil {
- failTest(fmt.Errorf("multiple primary integration platforms found in namespace %q", ns))
- }
- pl = &p
- }
- if pl == nil {
- failTest(fmt.Errorf("multiple integration platforms found in namespace %q but no one is primary", ns))
- }
- return pl
+ failTest(fmt.Errorf("multiple integration platforms found in namespace %q", ns))
}
return &lst.Items[0]
}
@@ -1934,6 +1920,21 @@ func PlatformByName(ns string, name string) func() *v1.IntegrationPlatform {
}
}
+func IntegrationProfileByName(ns string, name string) func() *v1.IntegrationProfile {
+ return func() *v1.IntegrationProfile {
+ lst := v1.NewIntegrationProfileList()
+ if err := TestClient().List(TestContext, &lst, ctrl.InNamespace(ns)); err != nil {
+ failTest(err)
+ }
+ for _, pc := range lst.Items {
+ if pc.Name == name {
+ return &pc
+ }
+ }
+ return nil
+ }
+}
+
func CamelCatalog(ns, name string) func() *v1.CamelCatalog {
return func() *v1.CamelCatalog {
cat := v1.CamelCatalog{}
@@ -1950,6 +1951,43 @@ func CamelCatalog(ns, name string) func() *v1.CamelCatalog {
}
}
+func IntegrationProfile(ns string) func() *v1.IntegrationProfile {
+ return func() *v1.IntegrationProfile {
+ lst := v1.NewIntegrationProfileList()
+ if err := TestClient().List(TestContext, &lst, ctrl.InNamespace(ns)); err != nil {
+ failTest(err)
+ }
+ if len(lst.Items) == 0 {
+ return nil
+ }
+ if len(lst.Items) > 1 {
+ failTest(fmt.Errorf("multiple integration profiles found in namespace %q", ns))
+ }
+ return &lst.Items[0]
+ }
+}
+
+func CreateIntegrationProfile(profile *v1.IntegrationProfile) error {
+ return TestClient().Create(TestContext, profile)
+}
+
+func UpdateIntegrationProfile(ns string, upd func(ipr *v1.IntegrationProfile)) error {
+ ipr := IntegrationProfile(ns)()
+ if ipr == nil {
+ return fmt.Errorf("unable to locate Integration Profile in %s", ns)
+ }
+ target := ipr.DeepCopy()
+ upd(target)
+ // For some reason, full patch fails on some clusters
+ p, err := patch.MergePatch(ipr, target)
+ if err != nil {
+ return err
+ } else if len(p) == 0 {
+ return nil
+ }
+ return TestClient().Patch(TestContext, target, ctrl.RawPatch(types.MergePatchType, p))
+}
+
func CreateCamelCatalog(catalog *v1.CamelCatalog) func() error {
return func() error {
return TestClient().Create(TestContext, catalog)
@@ -2068,6 +2106,16 @@ func SelectedPlatformPhase(ns string, name string) func() v1.IntegrationPlatform
}
}
+func SelectedIntegrationProfilePhase(ns string, name string) func() v1.IntegrationProfilePhase {
+ return func() v1.IntegrationProfilePhase {
+ pc := IntegrationProfileByName(ns, name)()
+ if pc == nil {
+ return ""
+ }
+ return pc.Status.Phase
+ }
+}
+
func PlatformHas(ns string, predicate func(pl *v1.IntegrationPlatform) bool) func() bool {
return func() bool {
pl := Platform(ns)()
@@ -2134,20 +2182,6 @@ func AssignPlatformToOperator(ns, operator string) error {
return TestClient().Update(TestContext, pl)
}
-func ConfigureSecondaryPlatformWith(ns string, customizer func(pl *v1.IntegrationPlatform)) error {
- pl := Platform(ns)()
- if pl == nil {
- return errors.New("cannot find primary platform")
- }
-
- v1.SetAnnotation(&pl.ObjectMeta, v1.SecondaryPlatformAnnotation, "true")
- pl.ObjectMeta.ResourceVersion = ""
- pl.Name = ""
- pl.Status = v1.IntegrationPlatformStatus{}
- customizer(pl)
- return TestClient().Create(TestContext, pl)
-}
-
func CRDs() func() []metav1.APIResource {
return func() []metav1.APIResource {
diff --git a/e2e/support/util/dump.go b/e2e/support/util/dump.go
index 1b7a0d6c25..142246199d 100644
--- a/e2e/support/util/dump.go
+++ b/e2e/support/util/dump.go
@@ -188,6 +188,21 @@ func Dump(ctx context.Context, c client.Client, ns string, t *testing.T) error {
t.Logf("---\n%s\n---\n", string(pdata))
}
+ // IntegrationProfiles
+ iprs, err := camelClient.CamelV1().IntegrationProfiles(ns).List(ctx, metav1.ListOptions{})
+ if err != nil {
+ return err
+ }
+ t.Logf("Found %d integration profiles:\n", len(iprs.Items))
+ for _, p := range iprs.Items {
+ ref := p
+ pdata, err := kubernetes.ToYAMLNoManagedFields(&ref)
+ if err != nil {
+ return err
+ }
+ t.Logf("---\n%s\n---\n", string(pdata))
+ }
+
// CamelCatalogs
cats, err := camelClient.CamelV1().CamelCatalogs(ns).List(ctx, metav1.ListOptions{})
if err != nil {
diff --git a/helm/camel-k/crds/crd-integration-platform.yaml b/helm/camel-k/crds/crd-integration-platform.yaml
index 97dc83d033..f154962280 100644
--- a/helm/camel-k/crds/crd-integration-platform.yaml
+++ b/helm/camel-k/crds/crd-integration-platform.yaml
@@ -95,7 +95,7 @@ spec:
baseImage:
description: a base image that can be used as base layer for all
images. It can be useful if you want to provide some custom
- base image with further utility softwares
+ base image with further utility software
type: string
buildCatalogToolTimeout:
description: 'the timeout (in seconds) to use when creating the
@@ -428,8 +428,8 @@ spec:
repositories:
description: remote repository used to retrieve Kamelet catalog
items:
- description: IntegrationPlatformKameletRepositorySpec defines
- the location of the Kamelet catalog to use.
+ description: KameletRepositorySpec defines the location of the
+ Kamelet catalog to use.
properties:
uri:
description: the remote repository in the format github:ORG/REPO/PATH_TO_KAMELETS_FOLDER
@@ -1558,27 +1558,14 @@ spec:
platform:
description: The configuration of Platform trait
properties:
- auto:
- description: To automatically detect from the environment
- if a default platform can be created (it will be created
- on OpenShift only).
- type: boolean
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
for backward compatibility.'
type: object
x-kubernetes-preserve-unknown-fields: true
- createDefault:
- description: To create a default (empty) platform when the
- platform is missing.
- type: boolean
enabled:
description: 'Deprecated: no longer in use.'
type: boolean
- global:
- description: Indicates if the platform should be created globally
- in the case of global operator (default true).
- type: boolean
type: object
pod:
description: The configuration of Pod trait
@@ -1907,7 +1894,7 @@ spec:
baseImage:
description: a base image that can be used as base layer for all
images. It can be useful if you want to provide some custom
- base image with further utility softwares
+ base image with further utility software
type: string
buildCatalogToolTimeout:
description: 'the timeout (in seconds) to use when creating the
@@ -2280,8 +2267,8 @@ spec:
repositories:
description: remote repository used to retrieve Kamelet catalog
items:
- description: IntegrationPlatformKameletRepositorySpec defines
- the location of the Kamelet catalog to use.
+ description: KameletRepositorySpec defines the location of the
+ Kamelet catalog to use.
properties:
uri:
description: the remote repository in the format github:ORG/REPO/PATH_TO_KAMELETS_FOLDER
@@ -3418,27 +3405,14 @@ spec:
platform:
description: The configuration of Platform trait
properties:
- auto:
- description: To automatically detect from the environment
- if a default platform can be created (it will be created
- on OpenShift only).
- type: boolean
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
for backward compatibility.'
type: object
x-kubernetes-preserve-unknown-fields: true
- createDefault:
- description: To create a default (empty) platform when the
- platform is missing.
- type: boolean
enabled:
description: 'Deprecated: no longer in use.'
type: boolean
- global:
- description: Indicates if the platform should be created globally
- in the case of global operator (default true).
- type: boolean
type: object
pod:
description: The configuration of Pod trait
diff --git a/helm/camel-k/crds/crd-integration-profile.yaml b/helm/camel-k/crds/crd-integration-profile.yaml
new file mode 100644
index 0000000000..a5cdb650a7
--- /dev/null
+++ b/helm/camel-k/crds/crd-integration-profile.yaml
@@ -0,0 +1,3493 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.6.1
+ creationTimestamp: null
+ labels:
+ app: camel-k
+ name: integrationprofiles.camel.apache.org
+spec:
+ group: camel.apache.org
+ names:
+ categories:
+ - kamel
+ - camel
+ kind: IntegrationProfile
+ listKind: IntegrationProfileList
+ plural: integrationprofiles
+ shortNames:
+ - ipr
+ singular: integrationprofile
+ scope: Namespaced
+ versions:
+ - additionalPrinterColumns:
+ - description: The integration profile phase
+ jsonPath: .status.phase
+ name: Phase
+ type: string
+ - description: The default runtime version
+ jsonPath: .status.build.runtimeVersion
+ name: Default runtime
+ type: string
+ name: v1
+ schema:
+ openAPIV3Schema:
+ description: IntegrationProfile is the resource used to apply user defined
+ settings to the Camel K operator behavior. It defines the behavior of all
+ Custom Resources (`IntegrationKit`, `Integration`, `Kamelet`) in the given
+ namespace.
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: IntegrationProfileSpec applies user defined settings to the
+ IntegrationProfile.
+ properties:
+ build:
+ description: specify how to build the Integration/IntegrationKits
+ properties:
+ 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
+ maven:
+ description: Maven configuration used to build the Camel/Camel-Quarkus
+ applications
+ properties:
+ caSecrets:
+ description: The Secrets name and key, containing the CA certificate(s)
+ used to connect to remote Maven repositories. It can contain
+ X.509 certificates, and PKCS#7 formatted certificate chains.
+ A JKS formatted keystore is automatically created to store
+ the CA certificate(s), and configured to be used as a trusted
+ certificate(s) by the Maven commands. Note that the root
+ CA certificates are also imported into the created keystore.
+ items:
+ description: SecretKeySelector selects a key of a Secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind, uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key must
+ be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: array
+ cliOptions:
+ description: The CLI options that are appended to the list
+ of arguments for Maven commands, e.g., `-V,--no-transfer-progress,-Dstyle.color=never`.
+ See https://maven.apache.org/ref/3.8.4/maven-embedder/cli.html.
+ items:
+ type: string
+ type: array
+ extension:
+ description: The Maven build extensions. See https://maven.apache.org/guides/mini/guide-using-extensions.html.
+ items:
+ description: MavenArtifact defines a GAV (Group:Artifact:Version)
+ Maven artifact.
+ properties:
+ artifactId:
+ description: Maven Artifact
+ type: string
+ groupId:
+ description: Maven Group
+ type: string
+ version:
+ description: Maven Version
+ type: string
+ required:
+ - artifactId
+ - groupId
+ type: object
+ type: array
+ localRepository:
+ description: The path of the local Maven repository.
+ type: string
+ profiles:
+ description: A reference to the ConfigMap or Secret key that
+ contains the Maven profile.
+ items:
+ description: ValueSource --.
+ properties:
+ configMapKeyRef:
+ description: Selects a key of a ConfigMap.
+ properties:
+ key:
+ description: The key to select.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the ConfigMap or its
+ key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ secretKeyRef:
+ description: Selects a key of a secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key
+ must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: object
+ type: array
+ properties:
+ additionalProperties:
+ type: string
+ description: The Maven properties.
+ type: object
+ settings:
+ description: A reference to the ConfigMap or Secret key that
+ contains the Maven settings.
+ properties:
+ configMapKeyRef:
+ description: Selects a key of a ConfigMap.
+ properties:
+ key:
+ description: The key to select.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the ConfigMap or its
+ key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ secretKeyRef:
+ description: Selects a key of a secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key
+ must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: object
+ settingsSecurity:
+ description: A reference to the ConfigMap or Secret key that
+ contains the security of the Maven settings.
+ properties:
+ configMapKeyRef:
+ description: Selects a key of a ConfigMap.
+ properties:
+ key:
+ description: The key to select.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the ConfigMap or its
+ key must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ secretKeyRef:
+ description: Selects a key of a secret.
+ properties:
+ key:
+ description: The key of the secret to select from. Must
+ be a valid secret key.
+ type: string
+ name:
+ description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
+ TODO: Add other useful fields. apiVersion, kind,
+ uid?'
+ type: string
+ optional:
+ description: Specify whether the Secret or its key
+ must be defined
+ type: boolean
+ required:
+ - key
+ type: object
+ type: object
+ type: object
+ registry:
+ description: the image registry used to push/pull Integration
+ images
+ properties:
+ address:
+ description: the URI to access
+ type: string
+ ca:
+ description: the configmap which stores the Certificate Authority
+ type: string
+ insecure:
+ description: if the container registry is insecure (ie, http
+ only)
+ type: boolean
+ organization:
+ description: the registry organization
+ type: string
+ secret:
+ description: the secret where credentials are stored
+ type: string
+ type: object
+ runtimeProvider:
+ description: the runtime used. Likely Camel Quarkus (we used to
+ have main runtime which has been discontinued since version
+ 1.5)
+ type: string
+ runtimeVersion:
+ description: the Camel K Runtime dependency version
+ type: string
+ timeout:
+ description: how much time to wait before time out the pipeline
+ process
+ type: string
+ type: object
+ kamelet:
+ description: configuration to be executed to all Kamelets controlled
+ by this IntegrationProfile
+ properties:
+ repositories:
+ description: remote repository used to retrieve Kamelet catalog
+ items:
+ description: KameletRepositorySpec defines the location of the
+ Kamelet catalog to use.
+ properties:
+ uri:
+ description: the remote repository in the format github:ORG/REPO/PATH_TO_KAMELETS_FOLDER
+ type: string
+ type: object
+ type: array
+ type: object
+ traits:
+ description: list of traits to be executed for all the Integration/IntegrationKits
+ built from this IntegrationProfile
+ properties:
+ 3scale:
+ description: 'Deprecated: for backward compatibility.'
+ properties:
+ configuration:
+ description: TraitConfiguration parameters configuration
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ required:
+ - configuration
+ type: object
+ addons:
+ additionalProperties:
+ description: AddonTrait represents the configuration of an addon
+ trait.
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ description: The extension point with addon traits
+ type: object
+ affinity:
+ description: The configuration of Affinity trait
+ properties:
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: Can be used to enable or disable a trait. All
+ traits share this common property.
+ type: boolean
+ nodeAffinityLabels:
+ description: Defines a set of nodes the integration pod(s)
+ are eligible to be scheduled on, based on labels on the
+ node.
+ items:
+ type: string
+ type: array
+ podAffinity:
+ description: Always co-locates multiple replicas of the integration
+ in the same node (default `false`).
+ type: boolean
+ podAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should be co-located with.
+ items:
+ type: string
+ type: array
+ podAntiAffinity:
+ description: Never co-locates multiple replicas of the integration
+ in the same node (default `false`).
+ type: boolean
+ podAntiAffinityLabels:
+ description: Defines a set of pods (namely those matching
+ the label selector, relative to the given namespace) that
+ the integration pod(s) should not be co-located with.
+ items:
+ type: string
+ type: array
+ type: object
+ builder:
+ description: The configuration of Builder trait
+ properties:
+ baseImage:
+ description: Specify a base image
+ type: string
+ configuration:
+ description: 'Legacy trait configuration parameters. Deprecated:
+ for backward compatibility.'
+ type: object
+ x-kubernetes-preserve-unknown-fields: true
+ enabled:
+ description: 'Deprecated: no longer in use.'
+ type: boolean
+ incrementalImageBuild:
+ description: Use the incremental image build option, to reuse
+ existing containers (default `true`)
+ type: boolean
+ limitCPU:
+ description: 'When using `pod` strategy, the maximum amount
+ of CPU required by the pod builder. Deprecated: use TasksRequestCPU
+ instead with task name `builder`.'
+ type: string
+ limitMemory:
+ description: 'When using `pod` strategy, the maximum amount
+ of memory required by the pod builder. Deprecated: use TasksRequestCPU
+ instead with task name `builder`.'
+ type: string
+ mavenProfiles:
+ description: 'A list of references pointing to configmaps/secrets
+ that contains a maven profile. The content of the maven
+ profile is expected to be a text containing a valid maven
+ profile starting with `