You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ts...@apache.org on 2022/07/27 01:25:05 UTC

[camel-k] branch main updated (4e90cc577 -> aa1bfbcb8)

This is an automated email from the ASF dual-hosted git repository.

tsato pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git


    from 4e90cc577 fix(ci): build before making images
     new aa9c2787c fix(ci): common & install e2e workflows fail silently
     new ed98e5e64 fix(e2e): fix failing e2e tests
     new 2a538884e fix(cli): fix kamel promote resources validation
     new 569fa13ed fix(trait): fix kameletbinding traits merge on integration
     new 95367ef68 fix(e2e): fix TestOperatorIDFiltering
     new aa1bfbcb8 chore(e2e): skip failing native build tests for OCP3

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 e2e/global/builder/build_test.go                   |   5 +
 e2e/global/common/config/config_test.go            |   8 +-
 e2e/global/common/files/timer-kamelet-usage.groovy |  19 ---
 e2e/global/common/languages/groovy_test.go         |   2 +-
 e2e/global/common/languages/init_test_support.go   |   4 +-
 e2e/global/common/languages/java_test.go           |   2 +-
 e2e/global/common/languages/js_test.go             |   2 +-
 e2e/global/common/languages/kotlin_test.go         |   2 +-
 e2e/global/common/languages/xml_test.go            |   2 +-
 e2e/global/common/languages/yaml_test.go           |   2 +-
 e2e/global/common/operator_metrics_test.go         |   2 +-
 e2e/global/common/traits/jvm_test.go               |   2 +-
 e2e/global/common/traits/openapi_test.go           |   2 +-
 e2e/namespace/install/cli/describe_test.go         |   2 +-
 e2e/namespace/install/cli/dev_mode_test.go         |   2 +-
 .../install/cli/duplicate_parameters_test.go       |   9 +-
 .../install/cli}/files/Java.java                   |   0
 .../install/cli}/files/promote-route.groovy        |   0
 .../cli}/files/resource-file-location-route.groovy |   0
 e2e/namespace/install/cli/global_kamelet_test.go   |   5 +-
 e2e/namespace/install/cli/global_test.go           |   1 +
 e2e/namespace/install/cli/install_test.go          |   5 +-
 .../install/cli}/promote_test.go                   |  21 ++--
 e2e/namespace/install/maven_http_proxy_test.go     |   5 +-
 .../install/operator_id_filtering_test.go          |  18 +--
 e2e/namespace/native/native_test.go                |   6 +
 e2e/support/test_support.go                        |   6 +-
 go.mod                                             |   4 +-
 go.sum                                             |   6 +-
 pkg/apis/camel/go.mod                              |   4 +-
 pkg/apis/camel/go.sum                              |   8 +-
 pkg/apis/camel/v1/common_types_support.go          |  40 +++++++
 pkg/apis/camel/v1/common_types_support_test.go     | 131 +++++++++++++++++++++
 pkg/client/camel/go.mod                            |   5 +-
 pkg/client/camel/go.sum                            |   8 +-
 pkg/cmd/promote.go                                 |  83 ++++++++-----
 pkg/controller/kameletbinding/integration.go       |   4 +-
 pkg/kamelet/repository/go.mod                      |   5 +-
 pkg/kamelet/repository/go.sum                      |   8 +-
 script/Makefile                                    |  22 ++--
 40 files changed, 339 insertions(+), 123 deletions(-)
 delete mode 100644 e2e/global/common/files/timer-kamelet-usage.groovy
 copy e2e/{global/common/build => namespace/install/cli}/files/Java.java (100%)
 rename e2e/{global/common => namespace/install/cli}/files/promote-route.groovy (100%)
 copy e2e/{global/common/config => namespace/install/cli}/files/resource-file-location-route.groovy (100%)
 rename e2e/{global/common => namespace/install/cli}/promote_test.go (88%)
 create mode 100644 pkg/apis/camel/v1/common_types_support_test.go


[camel-k] 03/06: fix(cli): fix kamel promote resources validation

Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 2a538884e9873aa2d3b93c7f64bbb219f9f21dcf
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Mon Jul 25 15:56:03 2022 +0900

    fix(cli): fix kamel promote resources validation
---
 pkg/cmd/promote.go | 83 +++++++++++++++++++++++++++++++++---------------------
 1 file changed, 51 insertions(+), 32 deletions(-)

diff --git a/pkg/cmd/promote.go b/pkg/cmd/promote.go
index 4eb216c89..bf81e3e81 100644
--- a/pkg/cmd/promote.go
+++ b/pkg/cmd/promote.go
@@ -20,6 +20,7 @@ package cmd
 import (
 	"context"
 	"fmt"
+	"reflect"
 	"regexp"
 	"strings"
 
@@ -194,43 +195,61 @@ func (o *promoteCmdOptions) validateDestResources(c client.Client, it *v1.Integr
 	for t, v := range mount {
 		switch t {
 		case "configs":
-			if list, ok := v.([]string); ok {
-				for _, cn := range list {
-					if conf, parseErr := resource.ParseConfig(cn); parseErr == nil {
-						if conf.StorageType() == resource.StorageTypeConfigmap {
-							configmaps = append(configmaps, conf.Name())
-						} else if conf.StorageType() == resource.StorageTypeSecret {
-							secrets = append(secrets, conf.Name())
-						}
-					} else {
-						return parseErr
+			list, ok := v.([]interface{})
+			if !ok {
+				return fmt.Errorf("invalid %s type: %s, value: %s", t, reflect.TypeOf(v), v)
+			}
+			for _, cn := range list {
+				s, ok := cn.(string)
+				if !ok {
+					return fmt.Errorf("invalid %s type: %s, value: %s", t, reflect.TypeOf(cn), cn)
+				}
+				if conf, parseErr := resource.ParseConfig(s); parseErr == nil {
+					if conf.StorageType() == resource.StorageTypeConfigmap {
+						configmaps = append(configmaps, conf.Name())
+					} else if conf.StorageType() == resource.StorageTypeSecret {
+						secrets = append(secrets, conf.Name())
 					}
+				} else {
+					return parseErr
 				}
 			}
 		case "resources":
-			if list, ok := v.([]string); ok {
-				for _, cn := range list {
-					if conf, parseErr := resource.ParseResource(cn); parseErr == nil {
-						if conf.StorageType() == resource.StorageTypeConfigmap {
-							configmaps = append(configmaps, conf.Name())
-						} else if conf.StorageType() == resource.StorageTypeSecret {
-							secrets = append(secrets, conf.Name())
-						}
-					} else {
-						return parseErr
+			list, ok := v.([]interface{})
+			if !ok {
+				return fmt.Errorf("invalid %s type: %s, value: %s", t, reflect.TypeOf(v), v)
+			}
+			for _, cn := range list {
+				s, ok := cn.(string)
+				if !ok {
+					return fmt.Errorf("invalid %s type: %s, value: %s", t, reflect.TypeOf(cn), cn)
+				}
+				if conf, parseErr := resource.ParseResource(s); parseErr == nil {
+					if conf.StorageType() == resource.StorageTypeConfigmap {
+						configmaps = append(configmaps, conf.Name())
+					} else if conf.StorageType() == resource.StorageTypeSecret {
+						secrets = append(secrets, conf.Name())
 					}
+				} else {
+					return parseErr
 				}
 			}
 		case "volumes":
-			if list, ok := v.([]string); ok {
-				for _, cn := range list {
-					if conf, parseErr := resource.ParseVolume(cn); parseErr == nil {
-						if conf.StorageType() == resource.StorageTypePVC {
-							pvcs = append(pvcs, conf.Name())
-						}
-					} else {
-						return parseErr
+			list, ok := v.([]interface{})
+			if !ok {
+				return fmt.Errorf("invalid %s type: %s, value: %s", t, reflect.TypeOf(v), v)
+			}
+			for _, cn := range list {
+				s, ok := cn.(string)
+				if !ok {
+					return fmt.Errorf("invalid %s type: %s, value: %s", t, reflect.TypeOf(cn), cn)
+				}
+				if conf, parseErr := resource.ParseVolume(s); parseErr == nil {
+					if conf.StorageType() == resource.StorageTypePVC {
+						pvcs = append(pvcs, conf.Name())
 					}
+				} else {
+					return parseErr
 				}
 			}
 		}
@@ -270,25 +289,25 @@ func (o *promoteCmdOptions) validateDestResources(c client.Client, it *v1.Integr
 	for _, name := range configmaps {
 		if !existsCm(o.Context, c, name, o.To) {
 			anyError = true
-			errorTrace += fmt.Sprintf("Configmap %s is missing from %s namespace\n", name, o.To)
+			errorTrace += fmt.Sprintf("\n\tConfigmap %s is missing from %s namespace", name, o.To)
 		}
 	}
 	for _, name := range secrets {
 		if !existsSecret(o.Context, c, name, o.To) {
 			anyError = true
-			errorTrace += fmt.Sprintf("Secret %s is missing from %s namespace\n", name, o.To)
+			errorTrace += fmt.Sprintf("\n\tSecret %s is missing from %s namespace", name, o.To)
 		}
 	}
 	for _, name := range pvcs {
 		if !existsPv(o.Context, c, name, o.To) {
 			anyError = true
-			errorTrace += fmt.Sprintf("PersistentVolume %s is missing from %s namespace\n", name, o.To)
+			errorTrace += fmt.Sprintf("\n\tPersistentVolume %s is missing from %s namespace", name, o.To)
 		}
 	}
 	for _, name := range kamelets {
 		if !existsKamelet(o.Context, c, name, o.To) {
 			anyError = true
-			errorTrace += fmt.Sprintf("Kamelet %s is missing from %s namespace\n", name, o.To)
+			errorTrace += fmt.Sprintf("\n\tKamelet %s is missing from %s namespace", name, o.To)
 		}
 	}
 


[camel-k] 01/06: fix(ci): common & install e2e workflows fail silently

Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit aa9c2787c2a92ba17b49de8fddb48b341aa0f493
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Fri Jul 22 19:15:06 2022 +0900

    fix(ci): common & install e2e workflows fail silently
    
    Fix #3465
---
 script/Makefile | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/script/Makefile b/script/Makefile
index c5cd2327b..c0a5c6886 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -233,12 +233,13 @@ test: do-build
 # This should execute all tests and not exit if one of the suites fail
 #
 test-integration: do-build
-	STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)" \
-	go test -timeout 60m -v ./e2e/global/common -tags=integration $(TEST_INTEGRATION_COMMON_RUN); \
-	go test -timeout 60m -v ./e2e/global/common/build -tags=integration $(TEST_INTEGRATION_COMMON_BUILD_RUN); \
-	go test -timeout 60m -v ./e2e/global/common/config -tags=integration $(TEST_INTEGRATION_COMMON_CONFIG_RUN); \
-	go test -timeout 60m -v ./e2e/global/common/languages -tags=integration $(TEST_INTEGRATION_COMMON_LANG_RUN); \
-	go test -timeout 60m -v ./e2e/global/common/traits -tags=integration $(TEST_INTEGRATION_COMMON_TRAITS_RUN)
+	FAILED=0; STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)"; \
+	go test -timeout 60m -v ./e2e/global/common -tags=integration $(TEST_INTEGRATION_COMMON_RUN) || FAILED=1; \
+	go test -timeout 60m -v ./e2e/global/common/build -tags=integration $(TEST_INTEGRATION_COMMON_BUILD_RUN) || FAILED=1; \
+	go test -timeout 60m -v ./e2e/global/common/config -tags=integration $(TEST_INTEGRATION_COMMON_CONFIG_RUN) || FAILED=1; \
+	go test -timeout 60m -v ./e2e/global/common/languages -tags=integration $(TEST_INTEGRATION_COMMON_LANG_RUN) || FAILED=1; \
+	go test -timeout 60m -v ./e2e/global/common/traits -tags=integration $(TEST_INTEGRATION_COMMON_TRAITS_RUN) || FAILED=1; \
+	exit $${FAILED}
 
 test-knative: do-build
 	STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)" \
@@ -267,10 +268,11 @@ test-registry-maven-wagon: do-build
 ###############################
 
 test-install: do-build
-	STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)" \
-	go test -timeout 60m -v ./e2e/namespace/install/ -tags=integration $(TEST_INSTALL_RUN) \
-	go test -timeout 60m -v ./e2e/namespace/install/cli -tags=integration $(TEST_INSTALL_CLI_RUN); \
-	go test -timeout 60m -v ./e2e/namespace/install/kustomize -tags=integration $(TEST_INSTALL_KUSTOMIZE_RUN)
+	FAILED=0; STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)"; \
+	go test -timeout 60m -v ./e2e/namespace/install/ -tags=integration $(TEST_INSTALL_RUN) || FAILED=1; \
+	go test -timeout 60m -v ./e2e/namespace/install/cli -tags=integration $(TEST_INSTALL_CLI_RUN) || FAILED=1; \
+	go test -timeout 60m -v ./e2e/namespace/install/kustomize -tags=integration $(TEST_INSTALL_KUSTOMIZE_RUN) || FAILED=1; \
+	exit $${FAILED}
 
 test-quarkus-native: do-build
 	STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)" \


[camel-k] 05/06: fix(e2e): fix TestOperatorIDFiltering

Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 95367ef684572ffa342e2c69399df855f94ef6a0
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Tue Jul 26 16:52:59 2022 +0900

    fix(e2e): fix TestOperatorIDFiltering
---
 .../install/operator_id_filtering_test.go          | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/e2e/namespace/install/operator_id_filtering_test.go b/e2e/namespace/install/operator_id_filtering_test.go
index 45239b29f..b142634d2 100644
--- a/e2e/namespace/install/operator_id_filtering_test.go
+++ b/e2e/namespace/install/operator_id_filtering_test.go
@@ -50,10 +50,6 @@ func TestOperatorIDFiltering(t *testing.T) {
 	}
 
 	WithNewTestNamespace(t, func(ns string) {
-
-		// Create only IntegrationPlatform so that `kamel run` with default operator ID succeeds
-		Expect(KamelInstall(ns, "--skip-operator-setup").Execute()).To(Succeed())
-
 		WithNewTestNamespace(t, func(nsop1 string) {
 			WithNewTestNamespace(t, func(nsop2 string) {
 				operator1 := "operator-1"
@@ -67,15 +63,15 @@ func TestOperatorIDFiltering(t *testing.T) {
 				t.Run("Operators ignore non-scoped integrations", func(t *testing.T) {
 					RegisterTestingT(t)
 
-					Expect(KamelRun(ns, "files/yaml.yaml", "--name", "untouched").Execute()).To(Succeed())
+					Expect(KamelRun(ns, "files/yaml.yaml", "--name", "untouched", "--force").Execute()).To(Succeed())
 					Consistently(IntegrationPhase(ns, "untouched"), 10*time.Second).Should(BeEmpty())
 				})
 
 				t.Run("Operators run scoped integrations", func(t *testing.T) {
 					RegisterTestingT(t)
 
-					Expect(KamelRun(ns, "files/yaml.yaml", "--name", "moving").Execute()).To(Succeed())
-					Expect(AssignIntegrationToOperator(ns, "moving", "operator-1")).To(Succeed())
+					Expect(KamelRun(ns, "files/yaml.yaml", "--name", "moving", "--force").Execute()).To(Succeed())
+					Expect(AssignIntegrationToOperator(ns, "moving", operator1)).To(Succeed())
 					Eventually(IntegrationPhase(ns, "moving"), TestTimeoutMedium).Should(Equal(v1.IntegrationPhaseRunning))
 					Eventually(IntegrationPodPhase(ns, "moving"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
 					Eventually(IntegrationLogs(ns, "moving"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
@@ -84,7 +80,7 @@ func TestOperatorIDFiltering(t *testing.T) {
 				t.Run("Operators can handoff scoped integrations", func(t *testing.T) {
 					RegisterTestingT(t)
 
-					Expect(AssignIntegrationToOperator(ns, "moving", "operator-2")).To(Succeed())
+					Expect(AssignIntegrationToOperator(ns, "moving", operator2)).To(Succeed())
 					Eventually(IntegrationPhase(ns, "moving"), TestTimeoutMedium).Should(Equal(v1.IntegrationPhaseRunning))
 					Expect(Kamel("rebuild", "-n", ns, "moving").Execute()).To(Succeed())
 					Eventually(IntegrationPhase(ns, "moving"), TestTimeoutMedium).Should(Equal(v1.IntegrationPhaseRunning))
@@ -111,9 +107,10 @@ func TestOperatorIDFiltering(t *testing.T) {
 					// Save resources by deleting "moving" integration
 					Expect(Kamel("delete", "moving", "-n", ns).Execute()).To(Succeed())
 
-					Expect(KamelRun(ns, "files/yaml.yaml", "--name", "pre-built", "-t", fmt.Sprintf("container.image=%s", image)).Execute()).To(Succeed())
+					Expect(KamelRun(ns, "files/yaml.yaml", "--name", "pre-built", "--force",
+						"-t", fmt.Sprintf("container.image=%s", image)).Execute()).To(Succeed())
 					Consistently(IntegrationPhase(ns, "pre-built"), 10*time.Second).Should(BeEmpty())
-					Expect(AssignIntegrationToOperator(ns, "pre-built", "operator-2")).To(Succeed())
+					Expect(AssignIntegrationToOperator(ns, "pre-built", operator2)).To(Succeed())
 					Eventually(IntegrationPhase(ns, "pre-built"), TestTimeoutShort).Should(Equal(v1.IntegrationPhaseRunning))
 					Eventually(IntegrationPodPhase(ns, "pre-built"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
 					Eventually(IntegrationLogs(ns, "pre-built"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
@@ -123,10 +120,11 @@ func TestOperatorIDFiltering(t *testing.T) {
 				t.Run("Operators can run scoped kamelet bindings", func(t *testing.T) {
 					RegisterTestingT(t)
 
-					Expect(KamelBind(ns, "timer-source?message=Hello", "log-sink", "--name", "klb").Execute()).To(Succeed())
+					Expect(KamelBind(ns, "timer-source?message=Hello", "log-sink",
+						"--name", "klb", "--force").Execute()).To(Succeed())
 					Consistently(Integration(ns, "klb"), 10*time.Second).Should(BeNil())
 
-					Expect(AssignKameletBindingToOperator(ns, "klb", "operator-1")).To(Succeed())
+					Expect(AssignKameletBindingToOperator(ns, "klb", operator1)).To(Succeed())
 					Eventually(Integration(ns, "klb"), TestTimeoutShort).ShouldNot(BeNil())
 					Eventually(IntegrationPhase(ns, "klb"), TestTimeoutMedium).Should(Equal(v1.IntegrationPhaseRunning))
 					Eventually(IntegrationPodPhase(ns, "klb"), TestTimeoutLong).Should(Equal(corev1.PodRunning))


[camel-k] 06/06: chore(e2e): skip failing native build tests for OCP3

Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit aa1bfbcb839fe467fe709bfcc43de8f46a6b9682
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Tue Jul 26 19:13:10 2022 +0900

    chore(e2e): skip failing native build tests for OCP3
---
 e2e/global/builder/build_test.go    | 5 +++++
 e2e/namespace/native/native_test.go | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/e2e/global/builder/build_test.go b/e2e/global/builder/build_test.go
index 4e4abfb76..7a379ae2e 100644
--- a/e2e/global/builder/build_test.go
+++ b/e2e/global/builder/build_test.go
@@ -57,6 +57,11 @@ func TestKitKnativeFullBuild(t *testing.T) {
 }
 
 func TestKitTimerToLogFullNativeBuild(t *testing.T) {
+	if os.Getenv("CAMEL_K_CLUSTER_OCP3") == "true" {
+		t.Skip("INFO: Skipping test as known to never pass on OCP3")
+		return
+	}
+
 	doKitFullBuild(t, "timer-to-log", "4Gi", "15m0s", TestTimeoutVeryLong, kitOptions{
 		dependencies: []string{
 			"camel:timer", "camel:log",
diff --git a/e2e/namespace/native/native_test.go b/e2e/namespace/native/native_test.go
index c84e49704..f2b10692c 100644
--- a/e2e/namespace/native/native_test.go
+++ b/e2e/namespace/native/native_test.go
@@ -23,6 +23,7 @@ limitations under the License.
 package native
 
 import (
+	"os"
 	"testing"
 
 	. "github.com/onsi/gomega"
@@ -39,6 +40,11 @@ var (
 )
 
 func TestNativeIntegrations(t *testing.T) {
+	if os.Getenv("CAMEL_K_CLUSTER_OCP3") == "true" {
+		t.Skip("INFO: Skipping test as known to never pass on OCP3")
+		return
+	}
+
 	WithNewTestNamespace(t, func(ns string) {
 		operatorID := "camel-k-quarkus-native"
 		Expect(KamelInstallWithID(operatorID, ns,


[camel-k] 04/06: fix(trait): fix kameletbinding traits merge on integration

Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 569fa13ed9972421daa66c6f3d374e4c56f9e789
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Tue Jul 26 00:17:36 2022 +0900

    fix(trait): fix kameletbinding traits merge on integration
---
 go.mod                                         |   4 +-
 go.sum                                         |   6 +-
 pkg/apis/camel/go.mod                          |   4 +-
 pkg/apis/camel/go.sum                          |   8 +-
 pkg/apis/camel/v1/common_types_support.go      |  40 ++++++++
 pkg/apis/camel/v1/common_types_support_test.go | 131 +++++++++++++++++++++++++
 pkg/client/camel/go.mod                        |   5 +-
 pkg/client/camel/go.sum                        |   8 +-
 pkg/controller/kameletbinding/integration.go   |   4 +-
 pkg/kamelet/repository/go.mod                  |   5 +-
 pkg/kamelet/repository/go.sum                  |   8 +-
 11 files changed, 208 insertions(+), 15 deletions(-)

diff --git a/go.mod b/go.mod
index df0000a5c..9af171225 100644
--- a/go.mod
+++ b/go.mod
@@ -57,7 +57,7 @@ require (
 	k8s.io/gengo v0.0.0-20211129171323-c02415ce4185
 	k8s.io/klog/v2 v2.40.1
 	k8s.io/kubectl v0.22.5
-	k8s.io/utils v0.0.0-20211208161948-7d6a63dca704
+	k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e
 	knative.dev/eventing v0.30.3
 	knative.dev/pkg v0.0.0-20220301181942-2fdd5f232e77
 	knative.dev/serving v0.30.0
@@ -111,7 +111,7 @@ require (
 	github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
 	github.com/hashicorp/golang-lru v0.5.4 // indirect
 	github.com/hashicorp/hcl v1.0.0 // indirect
-	github.com/imdario/mergo v0.3.12 // indirect
+	github.com/imdario/mergo v0.3.13 // indirect
 	github.com/inconshreveable/mousetrap v1.0.0 // indirect
 	github.com/json-iterator/go v1.1.12 // indirect
 	github.com/kelseyhightower/envconfig v1.4.0 // indirect
diff --git a/go.sum b/go.sum
index 3a4c4fa9f..ea70353e5 100644
--- a/go.sum
+++ b/go.sum
@@ -799,8 +799,9 @@ github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ
 github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
 github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
 github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
-github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
 github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
+github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
+github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
 github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
 github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
 github.com/influxdata/tdigest v0.0.0-20180711151920-a7d76c6f093a/go.mod h1:9GkyshztGufsdPQWjH+ifgnIr3xNUL5syI70g2dzU1o=
@@ -2137,8 +2138,9 @@ k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
 k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
-k8s.io/utils v0.0.0-20211208161948-7d6a63dca704 h1:ZKMMxTvduyf5WUtREOqg5LiXaN1KO/+0oOQPRFrClpo=
 k8s.io/utils v0.0.0-20211208161948-7d6a63dca704/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
+k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e h1:W1yba+Bpkwb5BatGKZALQ1yylhwnuD6CkYmrTibyLDM=
+k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 knative.dev/caching v0.0.0-20220302153644-5a6403ef2de5/go.mod h1:52//2yvw0iO3Nu2duAMI5BzfQKHWiXZuvRvzaypoGkU=
 knative.dev/eventing v0.30.3 h1:phw3Uw/iSQGo3BJokCbfb0+zpbwwbYdg2w+UKE46lk0=
 knative.dev/eventing v0.30.3/go.mod h1:JCqC8evTls1WiBTmYhPEGME6OQD8HFnLQjFPImwOEOg=
diff --git a/pkg/apis/camel/go.mod b/pkg/apis/camel/go.mod
index d825b8b33..8b6e3d2a3 100644
--- a/pkg/apis/camel/go.mod
+++ b/pkg/apis/camel/go.mod
@@ -3,9 +3,11 @@ module github.com/apache/camel-k/pkg/apis/camel
 go 1.17
 
 require (
+	github.com/imdario/mergo v0.3.13
 	github.com/stretchr/testify v1.7.0
 	k8s.io/api v0.22.5
 	k8s.io/apimachinery v0.22.5
+	k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e
 )
 
 require (
@@ -22,7 +24,7 @@ require (
 	golang.org/x/text v0.3.6 // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect
 	gopkg.in/yaml.v2 v2.4.0 // indirect
-	gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
+	gopkg.in/yaml.v3 v3.0.0 // indirect
 	k8s.io/klog/v2 v2.9.0 // indirect
 	sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
 )
diff --git a/pkg/apis/camel/go.sum b/pkg/apis/camel/go.sum
index 4c4d03587..20a0319db 100644
--- a/pkg/apis/camel/go.sum
+++ b/pkg/apis/camel/go.sum
@@ -54,6 +54,8 @@ github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2c
 github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA=
 github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
+github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
 github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
 github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ=
 github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
@@ -91,6 +93,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
 github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
 github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
 github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
@@ -201,8 +204,9 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
+gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 k8s.io/api v0.22.5 h1:xk7C+rMjF/EGELiD560jdmwzrB788mfcHiNbMQLIVI8=
@@ -214,6 +218,8 @@ k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
 k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM=
 k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
 k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw=
+k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e h1:W1yba+Bpkwb5BatGKZALQ1yylhwnuD6CkYmrTibyLDM=
+k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
 sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno=
 sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4=
diff --git a/pkg/apis/camel/v1/common_types_support.go b/pkg/apis/camel/v1/common_types_support.go
index 7f071a834..1726b5c4b 100644
--- a/pkg/apis/camel/v1/common_types_support.go
+++ b/pkg/apis/camel/v1/common_types_support.go
@@ -24,6 +24,8 @@ import (
 	"strings"
 
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+	"github.com/imdario/mergo"
 )
 
 func (in *Artifact) String() string {
@@ -59,6 +61,44 @@ func (p TraitProfile) Equal(other TraitProfile) bool {
 	return strings.EqualFold(string(p), string(other))
 }
 
+// Merge merges the given Traits into the receiver.
+func (t *Traits) Merge(other Traits) error {
+	// marshal both
+	data1, err := json.Marshal(t)
+	if err != nil {
+		return err
+	}
+	data2, err := json.Marshal(other)
+	if err != nil {
+		return err
+	}
+
+	// merge them
+	map1 := make(map[string]interface{})
+	if err := json.Unmarshal(data1, &map1); err != nil {
+		return err
+	}
+	map2 := make(map[string]interface{})
+	if err := json.Unmarshal(data2, &map2); err != nil {
+		return err
+	}
+	// values from merged trait take precedence over the original ones
+	if err := mergo.Merge(&map1, map2, mergo.WithOverride); err != nil {
+		return err
+	}
+
+	// unmarshal it
+	data, err := json.Marshal(map1)
+	if err != nil {
+		return err
+	}
+	if err = json.Unmarshal(data, &t); err != nil {
+		return err
+	}
+
+	return nil
+}
+
 // MarshalJSON returns m as the JSON encoding of m.
 func (m RawMessage) MarshalJSON() ([]byte, error) {
 	if m == nil {
diff --git a/pkg/apis/camel/v1/common_types_support_test.go b/pkg/apis/camel/v1/common_types_support_test.go
new file mode 100644
index 000000000..e46455493
--- /dev/null
+++ b/pkg/apis/camel/v1/common_types_support_test.go
@@ -0,0 +1,131 @@
+/*
+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 v1
+
+import (
+	"encoding/json"
+	"testing"
+
+	"github.com/apache/camel-k/pkg/apis/camel/v1/trait"
+
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+	"k8s.io/utils/pointer"
+)
+
+func TestTraitsMerge(t *testing.T) {
+	t1 := Traits{
+		Container: &trait.ContainerTrait{
+			Trait: trait.Trait{
+				Configuration: configurationFromMap(t, map[string]interface{}{
+					"name": "test-container",
+				}),
+			},
+			Auto:        pointer.Bool(false),
+			ServicePort: 81,
+		},
+		Logging: &trait.LoggingTrait{
+			Color: pointer.Bool(false),
+			Level: "INFO",
+		},
+		Addons: map[string]AddonTrait{
+			"master": toAddonTrait(t, map[string]interface{}{
+				"resourceName": "test-lock",
+			}),
+			"tracing": toAddonTrait(t, map[string]interface{}{
+				"enabled": true,
+			}),
+		},
+	}
+	t2 := Traits{
+		Container: &trait.ContainerTrait{
+			Trait: trait.Trait{
+				Configuration: configurationFromMap(t, map[string]interface{}{
+					"port": 8081,
+				}),
+			},
+			PortName: "http-8081",
+		},
+		Logging: &trait.LoggingTrait{
+			Color: pointer.Bool(true),
+			Level: "DEBUG",
+		},
+		Addons: map[string]AddonTrait{
+			"tracing": toAddonTrait(t, map[string]interface{}{
+				"serviceName": "test-integration",
+			}),
+		},
+	}
+
+	err := t1.Merge(t2)
+
+	require.NoError(t, err)
+
+	assert.NotNil(t, t1.Container)
+	assert.False(t, pointer.BoolDeref(t1.Container.Auto, true))
+	assert.Equal(t, "http-8081", t1.Container.PortName)
+	assert.Equal(t, 81, t1.Container.ServicePort)
+	assert.Equal(t,
+		configurationFromMap(t, map[string]interface{}{
+			"name": "test-container",
+			"port": 8081,
+		}),
+		t1.Container.Configuration)
+
+	// values from merged trait take precedence over the original ones
+	assert.NotNil(t, t1.Logging)
+	assert.True(t, pointer.BoolDeref(t1.Logging.Color, false))
+	assert.Equal(t, "DEBUG", t1.Logging.Level)
+
+	assert.NotNil(t, t1.Addons)
+	assert.Equal(t,
+		toAddonTrait(t, map[string]interface{}{
+			"resourceName": "test-lock",
+		}),
+		t1.Addons["master"])
+	assert.Equal(t,
+		toAddonTrait(t, map[string]interface{}{
+			"enabled":     true,
+			"serviceName": "test-integration",
+		}),
+		t1.Addons["tracing"])
+}
+
+func configurationFromMap(t *testing.T, configMap map[string]interface{}) *trait.Configuration {
+	t.Helper()
+
+	data, err := json.Marshal(configMap)
+	require.NoError(t, err)
+
+	return &trait.Configuration{
+		RawMessage: data,
+	}
+}
+
+func toAddonTrait(t *testing.T, config map[string]interface{}) AddonTrait {
+	t.Helper()
+
+	data, err := json.Marshal(config)
+	require.NoError(t, err)
+
+	var addon AddonTrait
+	err = json.Unmarshal(data, &addon)
+	require.NoError(t, err)
+
+	return addon
+}
diff --git a/pkg/client/camel/go.mod b/pkg/client/camel/go.mod
index 9e5ed510a..2217e517e 100644
--- a/pkg/client/camel/go.mod
+++ b/pkg/client/camel/go.mod
@@ -18,6 +18,7 @@ require (
 	github.com/google/go-cmp v0.5.5 // indirect
 	github.com/google/gofuzz v1.1.0 // indirect
 	github.com/googleapis/gnostic v0.5.5 // indirect
+	github.com/imdario/mergo v0.3.13 // indirect
 	github.com/json-iterator/go v1.1.11 // indirect
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/modern-go/reflect2 v1.0.1 // indirect
@@ -32,10 +33,10 @@ require (
 	google.golang.org/protobuf v1.26.0 // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect
 	gopkg.in/yaml.v2 v2.4.0 // indirect
-	gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
+	gopkg.in/yaml.v3 v3.0.0 // indirect
 	k8s.io/klog/v2 v2.9.0 // indirect
 	k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c // indirect
-	k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a // indirect
+	k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e // indirect
 	sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
 	sigs.k8s.io/yaml v1.2.0 // indirect
 )
diff --git a/pkg/client/camel/go.sum b/pkg/client/camel/go.sum
index 5042fd6e3..64887de67 100644
--- a/pkg/client/camel/go.sum
+++ b/pkg/client/camel/go.sum
@@ -125,6 +125,8 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
+github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
+github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
 github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
 github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ=
 github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
@@ -419,8 +421,9 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
+gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
@@ -439,8 +442,9 @@ k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM=
 k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
 k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c h1:jvamsI1tn9V0S8jicyX82qaFC0H/NKxv2e5mbqsgR80=
 k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw=
-k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a h1:8dYfu/Fc9Gz2rNJKB9IQRGgQOh2clmRzNIPPY1xLY5g=
 k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
+k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e h1:W1yba+Bpkwb5BatGKZALQ1yylhwnuD6CkYmrTibyLDM=
+k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
 rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
diff --git a/pkg/controller/kameletbinding/integration.go b/pkg/controller/kameletbinding/integration.go
index cde6da195..3f988d595 100644
--- a/pkg/controller/kameletbinding/integration.go
+++ b/pkg/controller/kameletbinding/integration.go
@@ -213,7 +213,9 @@ func configureBinding(integration *v1.Integration, bindings ...*bindings.Binding
 		if b == nil {
 			continue
 		}
-		integration.Spec.Traits = b.Traits
+		if err := integration.Spec.Traits.Merge(b.Traits); err != nil {
+			return err
+		}
 		for k, v := range b.ApplicationProperties {
 			entry, err := property.EncodePropertyFileEntry(k, v)
 			if err != nil {
diff --git a/pkg/kamelet/repository/go.mod b/pkg/kamelet/repository/go.mod
index 1c7f75d57..05ff34bed 100644
--- a/pkg/kamelet/repository/go.mod
+++ b/pkg/kamelet/repository/go.mod
@@ -22,6 +22,7 @@ require (
 	github.com/google/go-querystring v1.0.0 // indirect
 	github.com/google/gofuzz v1.1.0 // indirect
 	github.com/googleapis/gnostic v0.5.5 // indirect
+	github.com/imdario/mergo v0.3.13 // indirect
 	github.com/json-iterator/go v1.1.11 // indirect
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/modern-go/reflect2 v1.0.1 // indirect
@@ -37,12 +38,12 @@ require (
 	google.golang.org/protobuf v1.26.0 // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect
 	gopkg.in/yaml.v2 v2.4.0 // indirect
-	gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
+	gopkg.in/yaml.v3 v3.0.0 // indirect
 	k8s.io/api v0.22.5 // indirect
 	k8s.io/client-go v0.22.5 // indirect
 	k8s.io/klog/v2 v2.9.0 // indirect
 	k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c // indirect
-	k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a // indirect
+	k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e // indirect
 	sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
 	sigs.k8s.io/yaml v1.2.0 // indirect
 )
diff --git a/pkg/kamelet/repository/go.sum b/pkg/kamelet/repository/go.sum
index f81275cbe..3f115878d 100644
--- a/pkg/kamelet/repository/go.sum
+++ b/pkg/kamelet/repository/go.sum
@@ -129,6 +129,8 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
+github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
+github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
 github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
 github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ=
 github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
@@ -424,8 +426,9 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
+gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
@@ -444,8 +447,9 @@ k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM=
 k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
 k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c h1:jvamsI1tn9V0S8jicyX82qaFC0H/NKxv2e5mbqsgR80=
 k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw=
-k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a h1:8dYfu/Fc9Gz2rNJKB9IQRGgQOh2clmRzNIPPY1xLY5g=
 k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
+k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e h1:W1yba+Bpkwb5BatGKZALQ1yylhwnuD6CkYmrTibyLDM=
+k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
 rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=


[camel-k] 02/06: fix(e2e): fix failing e2e tests

Posted by ts...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tsato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit ed98e5e6430ade52e89152ffde29a01cc88e5bb5
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Mon Jul 25 14:03:00 2022 +0900

    fix(e2e): fix failing e2e tests
---
 e2e/global/common/config/config_test.go             |  8 ++++----
 e2e/global/common/languages/groovy_test.go          |  2 +-
 e2e/global/common/languages/init_test_support.go    |  4 ++--
 e2e/global/common/languages/java_test.go            |  2 +-
 e2e/global/common/languages/js_test.go              |  2 +-
 e2e/global/common/languages/kotlin_test.go          |  2 +-
 e2e/global/common/languages/xml_test.go             |  2 +-
 e2e/global/common/languages/yaml_test.go            |  2 +-
 e2e/global/common/operator_metrics_test.go          |  2 +-
 e2e/global/common/traits/jvm_test.go                |  2 +-
 e2e/global/common/traits/openapi_test.go            |  2 +-
 e2e/namespace/install/cli/describe_test.go          |  2 +-
 e2e/namespace/install/cli/dev_mode_test.go          |  2 +-
 .../install/cli/duplicate_parameters_test.go        |  9 +++++++--
 .../install/cli/files/Java.java}                    | 19 +++++++++++--------
 .../install/cli}/files/promote-route.groovy         |  0
 .../cli/files/resource-file-location-route.groovy}  |  5 +++--
 e2e/namespace/install/cli/global_kamelet_test.go    |  5 ++---
 e2e/namespace/install/cli/global_test.go            |  1 +
 e2e/namespace/install/cli/install_test.go           |  5 +++--
 .../install/cli}/promote_test.go                    | 21 ++++++++++++---------
 e2e/namespace/install/maven_http_proxy_test.go      |  5 ++---
 e2e/namespace/install/operator_id_filtering_test.go |  4 ++++
 e2e/support/test_support.go                         |  6 +++---
 24 files changed, 65 insertions(+), 49 deletions(-)

diff --git a/e2e/global/common/config/config_test.go b/e2e/global/common/config/config_test.go
index 7dc60fe48..cda0c2990 100644
--- a/e2e/global/common/config/config_test.go
+++ b/e2e/global/common/config/config_test.go
@@ -73,13 +73,13 @@ func TestRunConfigExamples(t *testing.T) {
 		// Store a configmap on the cluster
 		var cmData = make(map[string]string)
 		cmData["my-configmap-key"] = "my-configmap-content"
-		NewPlainTextConfigmap(ns, "my-cm", cmData)
+		CreatePlainTextConfigmap(ns, "my-cm", cmData)
 
 		// Store a configmap with multiple values
 		var cmDataMulti = make(map[string]string)
 		cmDataMulti["my-configmap-key"] = "should-not-see-it"
 		cmDataMulti["my-configmap-key-2"] = "my-configmap-content-2"
-		NewPlainTextConfigmap(ns, "my-cm-multi", cmDataMulti)
+		CreatePlainTextConfigmap(ns, "my-cm-multi", cmDataMulti)
 
 		t.Run("Config configmap", func(t *testing.T) {
 			Expect(KamelRunWithID(operatorID, ns, "./files/config-configmap-route.groovy", "--config", "configmap:my-cm").Execute()).To(Succeed())
@@ -123,7 +123,7 @@ func TestRunConfigExamples(t *testing.T) {
 		// Store a configmap as property file
 		var cmDataProps = make(map[string]string)
 		cmDataProps["my.properties"] = "my.key.1=hello\nmy.key.2=world"
-		NewPlainTextConfigmap(ns, "my-cm-properties", cmDataProps)
+		CreatePlainTextConfigmap(ns, "my-cm-properties", cmDataProps)
 
 		t.Run("Config configmap as property file", func(t *testing.T) {
 			Expect(KamelRunWithID(operatorID, ns, "./files/config-configmap-properties-route.groovy", "--config", "configmap:my-cm-properties").Execute()).To(Succeed())
@@ -138,7 +138,7 @@ func TestRunConfigExamples(t *testing.T) {
 		// Store a secret on the cluster
 		var secData = make(map[string]string)
 		secData["my-secret-key"] = "very top secret"
-		NewPlainTextSecret(ns, "my-sec", secData)
+		CreatePlainTextSecret(ns, "my-sec", secData)
 
 		t.Run("Config secret", func(t *testing.T) {
 			Expect(KamelRunWithID(operatorID, ns, "./files/config-secret-route.groovy", "--config", "secret:my-sec").Execute()).To(Succeed())
diff --git a/e2e/global/common/languages/groovy_test.go b/e2e/global/common/languages/groovy_test.go
index 17f8c896a..5c35e67e3 100644
--- a/e2e/global/common/languages/groovy_test.go
+++ b/e2e/global/common/languages/groovy_test.go
@@ -47,7 +47,7 @@ func TestRunSimpleGroovyExamples(t *testing.T) {
 		})
 
 		t.Run("init run groovy", func(t *testing.T) {
-			RunInitGeneratedExample(camelv1.LanguageGroovy, ns, t)
+			RunInitGeneratedExample(t, operatorID, ns, camelv1.LanguageGroovy)
 		})
 	})
 }
diff --git a/e2e/global/common/languages/init_test_support.go b/e2e/global/common/languages/init_test_support.go
index 923c0badf..ea4c66901 100644
--- a/e2e/global/common/languages/init_test_support.go
+++ b/e2e/global/common/languages/init_test_support.go
@@ -36,13 +36,13 @@ import (
 	camelv1 "github.com/apache/camel-k/pkg/apis/camel/v1"
 )
 
-func RunInitGeneratedExample(lang camelv1.Language, ns string, t *testing.T) {
+func RunInitGeneratedExample(t *testing.T, operatorID string, ns string, lang camelv1.Language) {
 	dir := util.MakeTempDir(t)
 	itName := fmt.Sprintf("init%s", string(lang))          // e.g. initjava
 	fileName := fmt.Sprintf("%s.%s", itName, string(lang)) // e.g. initjava.java
 	file := path.Join(dir, fileName)
 	Expect(Kamel("init", file).Execute()).To(Succeed())
-	Expect(KamelRun(ns, file).Execute()).To(Succeed())
+	Expect(KamelRunWithID(operatorID, ns, file).Execute()).To(Succeed())
 	Eventually(IntegrationPodPhase(ns, itName), TestTimeoutLong).Should(Equal(v1.PodRunning))
 	Eventually(IntegrationLogs(ns, itName), TestTimeoutShort).Should(ContainSubstring(languageInitExpectedString(lang)))
 	Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed())
diff --git a/e2e/global/common/languages/java_test.go b/e2e/global/common/languages/java_test.go
index ec7efd3c1..e498b87da 100644
--- a/e2e/global/common/languages/java_test.go
+++ b/e2e/global/common/languages/java_test.go
@@ -55,7 +55,7 @@ func TestRunSimpleJavaExamples(t *testing.T) {
 		})
 
 		t.Run("init run java", func(t *testing.T) {
-			RunInitGeneratedExample(camelv1.LanguageJavaSource, ns, t)
+			RunInitGeneratedExample(t, operatorID, ns, camelv1.LanguageJavaSource)
 		})
 	})
 }
diff --git a/e2e/global/common/languages/js_test.go b/e2e/global/common/languages/js_test.go
index daeaa3d7d..d7569499a 100644
--- a/e2e/global/common/languages/js_test.go
+++ b/e2e/global/common/languages/js_test.go
@@ -47,7 +47,7 @@ func TestRunSimpleJavaScriptExamples(t *testing.T) {
 		})
 
 		t.Run("init run JavaScript", func(t *testing.T) {
-			RunInitGeneratedExample(camelv1.LanguageJavaScript, ns, t)
+			RunInitGeneratedExample(t, operatorID, ns, camelv1.LanguageJavaScript)
 		})
 	})
 }
diff --git a/e2e/global/common/languages/kotlin_test.go b/e2e/global/common/languages/kotlin_test.go
index 6e43a8153..69cd58a2d 100644
--- a/e2e/global/common/languages/kotlin_test.go
+++ b/e2e/global/common/languages/kotlin_test.go
@@ -47,7 +47,7 @@ func TestRunSimpleKotlinExamples(t *testing.T) {
 		})
 
 		t.Run("init run Kotlin", func(t *testing.T) {
-			RunInitGeneratedExample(camelv1.LanguageKotlin, ns, t)
+			RunInitGeneratedExample(t, operatorID, ns, camelv1.LanguageKotlin)
 		})
 	})
 }
diff --git a/e2e/global/common/languages/xml_test.go b/e2e/global/common/languages/xml_test.go
index a332f0af3..04371cae4 100644
--- a/e2e/global/common/languages/xml_test.go
+++ b/e2e/global/common/languages/xml_test.go
@@ -47,7 +47,7 @@ func TestRunSimpleXmlExamples(t *testing.T) {
 		})
 
 		t.Run("init run xml", func(t *testing.T) {
-			RunInitGeneratedExample(camelv1.LanguageXML, ns, t)
+			RunInitGeneratedExample(t, operatorID, ns, camelv1.LanguageXML)
 		})
 	})
 }
diff --git a/e2e/global/common/languages/yaml_test.go b/e2e/global/common/languages/yaml_test.go
index 5a754e968..3a55ac330 100644
--- a/e2e/global/common/languages/yaml_test.go
+++ b/e2e/global/common/languages/yaml_test.go
@@ -47,7 +47,7 @@ func TestRunSimpleYamlExamples(t *testing.T) {
 		})
 
 		t.Run("init run yaml", func(t *testing.T) {
-			RunInitGeneratedExample(camelv1.LanguageYaml, ns, t)
+			RunInitGeneratedExample(t, operatorID, ns, camelv1.LanguageYaml)
 		})
 	})
 }
diff --git a/e2e/global/common/operator_metrics_test.go b/e2e/global/common/operator_metrics_test.go
index bd4658cb5..c0c1e9ed5 100644
--- a/e2e/global/common/operator_metrics_test.go
+++ b/e2e/global/common/operator_metrics_test.go
@@ -203,7 +203,7 @@ func TestMetrics(t *testing.T) {
 				"LoggerName":       Equal("camel-k.controller.integrationplatform"),
 				"Message":          Equal("Reconciling IntegrationPlatform"),
 				"RequestNamespace": Equal(ns),
-				"RequestName":      Equal("camel-k"),
+				"RequestName":      Equal(operatorID),
 			}))
 			Expect(err).To(BeNil())
 
diff --git a/e2e/global/common/traits/jvm_test.go b/e2e/global/common/traits/jvm_test.go
index b1ddae902..b26f46a9f 100644
--- a/e2e/global/common/traits/jvm_test.go
+++ b/e2e/global/common/traits/jvm_test.go
@@ -46,7 +46,7 @@ func TestJVMTrait(t *testing.T) {
 		source, err := ioutil.ReadFile("./files/jvm/sample-1.0.jar")
 		assert.Nil(t, err)
 		cmData["sample-1.0.jar"] = source
-		err = NewBinaryConfigmap(ns, "my-deps", cmData)
+		err = CreateBinaryConfigmap(ns, "my-deps", cmData)
 		assert.Nil(t, err)
 
 		t.Run("JVM trait classpath", func(t *testing.T) {
diff --git a/e2e/global/common/traits/openapi_test.go b/e2e/global/common/traits/openapi_test.go
index 61f2d3256..d9bf91303 100644
--- a/e2e/global/common/traits/openapi_test.go
+++ b/e2e/global/common/traits/openapi_test.go
@@ -93,7 +93,7 @@ func TestOpenAPIConfigmap(t *testing.T) {
 		assert.Nil(t, err)
 		var cmDataProps = make(map[string]string)
 		cmDataProps["petstore-api.yaml"] = string(openapiContent)
-		NewPlainTextConfigmap(ns, "my-openapi", cmDataProps)
+		CreatePlainTextConfigmap(ns, "my-openapi", cmDataProps)
 
 		Expect(KamelRunWithID(operatorID, ns,
 			"--name", "petstore",
diff --git a/e2e/namespace/install/cli/describe_test.go b/e2e/namespace/install/cli/describe_test.go
index b953b974a..c0fdc839d 100644
--- a/e2e/namespace/install/cli/describe_test.go
+++ b/e2e/namespace/install/cli/describe_test.go
@@ -70,7 +70,7 @@ func TestKamelCliDescribe(t *testing.T) {
 		})
 
 		t.Run("Test kamel describe integration platform", func(t *testing.T) {
-			platform := GetOutputString(Kamel("describe", "platform", "camel-k", "-n", ns))
+			platform := GetOutputString(Kamel("describe", "platform", operatorID, "-n", ns))
 			r, _ := regexp.Compile("(?sm).*Name:\\s+camel-k.*")
 			Expect(platform).To(MatchRegexp(r.String()))
 
diff --git a/e2e/namespace/install/cli/dev_mode_test.go b/e2e/namespace/install/cli/dev_mode_test.go
index 5decd8849..96b8d1d1e 100644
--- a/e2e/namespace/install/cli/dev_mode_test.go
+++ b/e2e/namespace/install/cli/dev_mode_test.go
@@ -135,7 +135,7 @@ func TestRunDevMode(t *testing.T) {
 			defer pipew.Close()
 			defer piper.Close()
 
-			file := util.MakeTempCopy(t, "../config/files/resource-file-location-route.groovy")
+			file := util.MakeTempCopy(t, "files/resource-file-location-route.groovy")
 
 			kamelRun := KamelRunWithContext(ctx, operatorID, ns, file, "--dev", "--resource", fmt.Sprintf("file:%s@/tmp/file.txt", tmpFile.Name()))
 			kamelRun.SetOut(pipew)
diff --git a/e2e/namespace/install/cli/duplicate_parameters_test.go b/e2e/namespace/install/cli/duplicate_parameters_test.go
index e6c52a21c..b3a114e1b 100644
--- a/e2e/namespace/install/cli/duplicate_parameters_test.go
+++ b/e2e/namespace/install/cli/duplicate_parameters_test.go
@@ -40,12 +40,17 @@ func TestDuplicateParameters(t *testing.T) {
 
 	// run kamel to output the traits/configuration structure in json format to check the processed values
 	// the tracing.enabled is false inside JavaDuplicateParams.java, so we can check the output of this trait as true.
-	cmdParams := []string{"kamel", "run", "files/JavaDuplicateParams.java", "-o", "json", "-t", "tracing.enabled=true", "--trait", "pull-secret.enabled=true", "--property", "prop1=true", "-p", "prop2=true"}
+	cmdParams := []string{"kamel", "run", "files/JavaDuplicateParams.java",
+		"-o", "json",
+		"-t", "tracing.enabled=true", "--trait", "pull-secret.enabled=true",
+		"--property", "prop1=true", "-p", "prop2=true",
+		"--force"}
 	comm, _, _ := cmd.NewKamelWithModelineCommand(ctx, cmdParams)
 
 	// the command is executed inside GetOutputString function
 	commOutput := GetOutputString(comm)
 
-	outParams := `"traits":{"affinity":{"enabled":true},"camel":{"properties":["prop1 = true","prop2 = true","foo = bar"]},"pull-secret":{"enabled":true},"addons":{"tracing":{"enabled":true}}}`
+	outParams :=
+		`"traits":{"affinity":{"enabled":true},"camel":{"properties":["prop1 = true","prop2 = true","foo = bar"]},"pull-secret":{"enabled":true},"addons":{"tracing":{"enabled":true}}}`
 	Expect(commOutput).To(ContainSubstring(outParams))
 }
diff --git a/e2e/global/common/files/promote-route.groovy b/e2e/namespace/install/cli/files/Java.java
similarity index 74%
copy from e2e/global/common/files/promote-route.groovy
copy to e2e/namespace/install/cli/files/Java.java
index 943a4ab91..66fef5fe8 100644
--- a/e2e/global/common/files/promote-route.groovy
+++ b/e2e/namespace/install/cli/files/Java.java
@@ -1,4 +1,3 @@
-// camel-k: language=groovy
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -16,10 +15,14 @@
  * limitations under the License.
  */
 
-from('timer:configmap')
-    .setBody()
-        .simple("resource:classpath:my-configmap-key")
-    .log('configmap: ${body}')
-    .setBody()
-        .simple("resource:classpath:my-secret-key")
-    .log('secret: ${body}')
\ No newline at end of file
+import org.apache.camel.builder.RouteBuilder;
+
+public class Java extends RouteBuilder {
+  @Override
+  public void configure() throws Exception {
+	  from("timer:tick")
+	  .setHeader("m").constant("string!")
+	  .setBody().simple("Magic${header.m}")
+      .log("${body}");
+  }
+}
diff --git a/e2e/global/common/files/promote-route.groovy b/e2e/namespace/install/cli/files/promote-route.groovy
similarity index 100%
rename from e2e/global/common/files/promote-route.groovy
rename to e2e/namespace/install/cli/files/promote-route.groovy
diff --git a/e2e/global/common/files/timer-kamelet-usage.groovy b/e2e/namespace/install/cli/files/resource-file-location-route.groovy
similarity index 85%
rename from e2e/global/common/files/timer-kamelet-usage.groovy
rename to e2e/namespace/install/cli/files/resource-file-location-route.groovy
index 11ad5bb27..076a2a9c7 100644
--- a/e2e/global/common/files/timer-kamelet-usage.groovy
+++ b/e2e/namespace/install/cli/files/resource-file-location-route.groovy
@@ -1,3 +1,4 @@
+// camel-k: language=groovy
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -15,5 +16,5 @@
  * limitations under the License.
  */
 
-from('kamelet:my-own-timer-source?message=Hello+world')
-    .to('log:info?showAll=false')
+from('file:/tmp/?fileName=file.txt&noop=true&idempotent=false')
+    .log('resource file content is: ${body}')
diff --git a/e2e/namespace/install/cli/global_kamelet_test.go b/e2e/namespace/install/cli/global_kamelet_test.go
index b03f1d16b..6884769fe 100644
--- a/e2e/namespace/install/cli/global_kamelet_test.go
+++ b/e2e/namespace/install/cli/global_kamelet_test.go
@@ -47,7 +47,8 @@ func TestRunGlobalKamelet(t *testing.T) {
 	}
 
 	WithGlobalOperatorNamespace(t, func(operatorNamespace string) {
-		Expect(KamelInstall(operatorNamespace, "--global", "--force").Execute()).To(Succeed())
+		operatorID := "camel-k-global-kamelet"
+		Expect(KamelInstallWithID(operatorID, operatorNamespace, "--global", "--force").Execute()).To(Succeed())
 
 		t.Run("Global operator + namespaced kamelet test", func(t *testing.T) {
 
@@ -55,7 +56,6 @@ func TestRunGlobalKamelet(t *testing.T) {
 			WithNewTestNamespace(t, func(ns2 string) {
 				Expect(CreateTimerKamelet(ns2, "my-own-timer-source")()).To(Succeed())
 
-				operatorID := "camel-k-local-ns2"
 				Expect(KamelInstallWithID(operatorID, ns2, "--skip-operator-setup", "--olm=false").Execute()).To(Succeed())
 
 				Expect(KamelRunWithID(operatorID, ns2, "files/timer-kamelet-usage.groovy").Execute()).To(Succeed())
@@ -71,7 +71,6 @@ func TestRunGlobalKamelet(t *testing.T) {
 
 			// NS3: namespace without operator
 			WithNewTestNamespace(t, func(ns3 string) {
-				operatorID := "camel-k-local-ns3"
 				Expect(KamelInstallWithID(operatorID, ns3, "--skip-operator-setup", "--olm=false").Execute()).To(Succeed())
 
 				Expect(KamelRunWithID(operatorID, ns3, "files/timer-kamelet-usage.groovy").Execute()).To(Succeed())
diff --git a/e2e/namespace/install/cli/global_test.go b/e2e/namespace/install/cli/global_test.go
index f96b76b32..12943ef7a 100644
--- a/e2e/namespace/install/cli/global_test.go
+++ b/e2e/namespace/install/cli/global_test.go
@@ -54,6 +54,7 @@ func TestRunGlobalInstall(t *testing.T) {
 	WithGlobalOperatorNamespace(t, func(operatorNamespace string) {
 		Expect(KamelInstall(operatorNamespace, "--global", "--force").Execute()).To(Succeed())
 		Eventually(OperatorPodPhase(operatorNamespace), TestTimeoutMedium).Should(Equal(corev1.PodRunning))
+
 		t.Run("Global test on namespace with platform", func(t *testing.T) {
 			WithNewTestNamespace(t, func(ns2 string) {
 				// Creating namespace local platform
diff --git a/e2e/namespace/install/cli/install_test.go b/e2e/namespace/install/cli/install_test.go
index 1df50622d..aee7732c9 100644
--- a/e2e/namespace/install/cli/install_test.go
+++ b/e2e/namespace/install/cli/install_test.go
@@ -73,9 +73,10 @@ func TestMavenRepositoryInstallation(t *testing.T) {
 	WithNewTestNamespace(t, func(ns string) {
 		operatorID := fmt.Sprintf("camel-k-%s", ns)
 		Expect(KamelInstallWithID(operatorID, ns, "--maven-repository", "https://my.repo.org/public/").Execute()).To(Succeed())
-		Eventually(Configmap(ns, "camel-k-maven-settings")).Should(Not(BeNil()))
+		configmapName := fmt.Sprintf("%s-maven-settings", operatorID)
+		Eventually(Configmap(ns, configmapName)).Should(Not(BeNil()))
 		Eventually(func() string {
-			return Configmap(ns, "camel-k-maven-settings")().Data["settings.xml"]
+			return Configmap(ns, configmapName)().Data["settings.xml"]
 		}).Should(ContainSubstring("https://my.repo.org/public/"))
 	})
 }
diff --git a/e2e/global/common/promote_test.go b/e2e/namespace/install/cli/promote_test.go
similarity index 88%
rename from e2e/global/common/promote_test.go
rename to e2e/namespace/install/cli/promote_test.go
index ba9ac85e6..76ad5b62a 100644
--- a/e2e/global/common/promote_test.go
+++ b/e2e/namespace/install/cli/promote_test.go
@@ -36,19 +36,20 @@ import (
 func TestKamelCLIPromote(t *testing.T) {
 	// Dev environment namespace
 	WithNewTestNamespace(t, func(nsDev string) {
-		Expect(KamelInstall(nsDev).Execute()).To(Succeed())
+		operatorDevID := "camel-k-cli-promote-dev"
+		Expect(KamelInstallWithID(operatorDevID, nsDev).Execute()).To(Succeed())
 
 		// Dev content configmap
 		var cmData = make(map[string]string)
 		cmData["my-configmap-key"] = "I am development configmap!"
-		NewPlainTextConfigmap(nsDev, "my-cm", cmData)
+		CreatePlainTextConfigmap(nsDev, "my-cm", cmData)
 		// Dev secret
 		var secData = make(map[string]string)
 		secData["my-secret-key"] = "very top secret development"
-		NewPlainTextSecret(nsDev, "my-sec", secData)
+		CreatePlainTextSecret(nsDev, "my-sec", secData)
 
 		t.Run("plain integration dev", func(t *testing.T) {
-			Expect(KamelRun(nsDev, "./files/promote-route.groovy",
+			Expect(KamelRunWithID(operatorDevID, nsDev, "./files/promote-route.groovy",
 				"--config", "configmap:my-cm",
 				"--config", "secret:my-sec",
 			).Execute()).To(Succeed())
@@ -60,30 +61,32 @@ func TestKamelCLIPromote(t *testing.T) {
 
 		t.Run("kamelet integration dev", func(t *testing.T) {
 			Expect(CreateTimerKamelet(nsDev, "my-own-timer-source")()).To(Succeed())
-			Expect(KamelRun(nsDev, "files/timer-kamelet-usage.groovy").Execute()).To(Succeed())
+			Expect(KamelRunWithID(operatorDevID, nsDev, "./files/timer-kamelet-usage.groovy").Execute()).To(Succeed())
 			Eventually(IntegrationPodPhase(nsDev, "timer-kamelet-usage"), TestTimeoutMedium).Should(Equal(corev1.PodRunning))
 			Eventually(IntegrationLogs(nsDev, "timer-kamelet-usage"), TestTimeoutShort).Should(ContainSubstring("Hello world"))
 		})
 
 		t.Run("kamelet binding dev", func(t *testing.T) {
 			Expect(CreateTimerKamelet(nsDev, "kb-timer-source")()).To(Succeed())
-			Expect(KamelBind(nsDev, "kb-timer-source", "log:info", "-p", "source.message=my-kamelet-binding-rocks").Execute()).To(Succeed())
+			Expect(KamelBindWithID(operatorDevID, nsDev, "kb-timer-source", "log:info", "-p", "source.message=my-kamelet-binding-rocks").Execute()).To(Succeed())
 			Eventually(IntegrationPodPhase(nsDev, "kb-timer-source-to-log"), TestTimeoutMedium).Should(Equal(corev1.PodRunning))
 			Eventually(IntegrationLogs(nsDev, "kb-timer-source-to-log"), TestTimeoutShort).Should(ContainSubstring("my-kamelet-binding-rocks"))
 		})
 
 		// Prod environment namespace
 		WithNewTestNamespace(t, func(nsProd string) {
-			Expect(KamelInstall(nsProd).Execute()).To(Succeed())
+			operatorProdID := "camel-k-cli-promote-prod"
+			Expect(KamelInstallWithID(operatorProdID, nsProd).Execute()).To(Succeed())
 			Eventually(PlatformPhase(nsProd), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
 
 			t.Run("no configmap in destination", func(t *testing.T) {
 				Expect(Kamel("promote", "-n", nsDev, "promote-route", "--to", nsProd).Execute()).NotTo(Succeed())
 			})
+
 			// Prod content configmap
 			var cmData = make(map[string]string)
 			cmData["my-configmap-key"] = "I am production!"
-			NewPlainTextConfigmap(nsProd, "my-cm", cmData)
+			CreatePlainTextConfigmap(nsProd, "my-cm", cmData)
 
 			t.Run("no secret in destination", func(t *testing.T) {
 				Expect(Kamel("promote", "-n", nsDev, "promote-route", "--to", nsProd).Execute()).NotTo(Succeed())
@@ -92,7 +95,7 @@ func TestKamelCLIPromote(t *testing.T) {
 			// Prod secret
 			var secData = make(map[string]string)
 			secData["my-secret-key"] = "very top secret production"
-			NewPlainTextSecret(nsProd, "my-sec", secData)
+			CreatePlainTextSecret(nsProd, "my-sec", secData)
 
 			t.Run("plain integration promotion", func(t *testing.T) {
 				Expect(Kamel("promote", "-n", nsDev, "promote-route", "--to", nsProd).Execute()).To(Succeed())
diff --git a/e2e/namespace/install/maven_http_proxy_test.go b/e2e/namespace/install/maven_http_proxy_test.go
index 3e0302366..06b52d676 100644
--- a/e2e/namespace/install/maven_http_proxy_test.go
+++ b/e2e/namespace/install/maven_http_proxy_test.go
@@ -147,6 +147,7 @@ func TestMavenProxy(t *testing.T) {
 		noProxy = append(noProxy, svc.Spec.ClusterIPs...)
 
 		// Install Camel K with the HTTP proxy
+		operatorID := "camel-k-maven-proxy"
 		olm, olmErr := olm.IsAPIAvailable(TestContext, TestClient(), ns)
 		installed, inErr := kubernetes.IsAPIResourceInstalled(TestClient(), configv1.GroupVersion.String(), reflect.TypeOf(configv1.Proxy{}).Name())
 		permission, pErr := kubernetes.CheckPermission(TestContext, TestClient(), configv1.GroupName, reflect.TypeOf(configv1.Proxy{}).Name(), "", "cluster", "edit")
@@ -176,10 +177,8 @@ func TestMavenProxy(t *testing.T) {
 			}()
 
 			// ENV values should be injected by the OLM
-			operatorID := "camel-k-maven-proxy"
 			Expect(KamelInstallWithID(operatorID, ns).Execute()).To(Succeed())
 		} else {
-			operatorID := "camel-k-maven-proxy"
 			Expect(KamelInstallWithID(operatorID, ns,
 				"--operator-env-vars", fmt.Sprintf("HTTP_PROXY=http://%s", hostname),
 				// TODO: enable TLS for the HTTPS proxy when Maven supports it
@@ -193,7 +192,7 @@ func TestMavenProxy(t *testing.T) {
 
 		// Run the Integration
 		name := "java"
-		Expect(KamelRun(ns, "files/Java.java", "--name", name).Execute()).To(Succeed())
+		Expect(KamelRunWithID(operatorID, ns, "files/Java.java", "--name", name).Execute()).To(Succeed())
 
 		Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
 		Eventually(IntegrationConditionStatus(ns, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
diff --git a/e2e/namespace/install/operator_id_filtering_test.go b/e2e/namespace/install/operator_id_filtering_test.go
index 1f8fa0b0f..45239b29f 100644
--- a/e2e/namespace/install/operator_id_filtering_test.go
+++ b/e2e/namespace/install/operator_id_filtering_test.go
@@ -50,6 +50,10 @@ func TestOperatorIDFiltering(t *testing.T) {
 	}
 
 	WithNewTestNamespace(t, func(ns string) {
+
+		// Create only IntegrationPlatform so that `kamel run` with default operator ID succeeds
+		Expect(KamelInstall(ns, "--skip-operator-setup").Execute()).To(Succeed())
+
 		WithNewTestNamespace(t, func(nsop1 string) {
 			WithNewTestNamespace(t, func(nsop2 string) {
 				operator1 := "operator-1"
diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go
index 2f8cbc150..1d690cfb1 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -1131,7 +1131,7 @@ func AutogeneratedConfigmapsCount(ns string) func() int {
 	}
 }
 
-func NewPlainTextConfigmap(ns string, name string, data map[string]string) error {
+func CreatePlainTextConfigmap(ns string, name string, data map[string]string) error {
 	cm := corev1.ConfigMap{
 		TypeMeta: metav1.TypeMeta{
 			Kind:       "ConfigMap",
@@ -1146,7 +1146,7 @@ func NewPlainTextConfigmap(ns string, name string, data map[string]string) error
 	return TestClient().Create(TestContext, &cm)
 }
 
-func NewBinaryConfigmap(ns string, name string, data map[string][]byte) error {
+func CreateBinaryConfigmap(ns string, name string, data map[string][]byte) error {
 	cm := corev1.ConfigMap{
 		TypeMeta: metav1.TypeMeta{
 			Kind:       "ConfigMap",
@@ -1161,7 +1161,7 @@ func NewBinaryConfigmap(ns string, name string, data map[string][]byte) error {
 	return TestClient().Create(TestContext, &cm)
 }
 
-func NewPlainTextSecret(ns string, name string, data map[string]string) error {
+func CreatePlainTextSecret(ns string, name string, data map[string]string) error {
 	sec := corev1.Secret{
 		TypeMeta: metav1.TypeMeta{
 			Kind:       "Secret",