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

[camel-k] branch release-1.7.x updated: [TEST] Global kamelet test - support for openshift

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

astefanutti pushed a commit to branch release-1.7.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/release-1.7.x by this push:
     new 638dc33  [TEST] Global kamelet test - support for openshift
638dc33 is described below

commit 638dc33f0aae607fd46b8128a1a8b22092f80233
Author: Andrej Smigala <as...@redhat.com>
AuthorDate: Tue Oct 5 13:13:45 2021 +0200

    [TEST] Global kamelet test - support for openshift
---
 e2e/common/cli/global_kamelet_test.go | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/e2e/common/cli/global_kamelet_test.go b/e2e/common/cli/global_kamelet_test.go
index 0c890fa..337a187 100644
--- a/e2e/common/cli/global_kamelet_test.go
+++ b/e2e/common/cli/global_kamelet_test.go
@@ -46,10 +46,10 @@ func TestRunGlobalKamelet(t *testing.T) {
 		}
 	}
 
-	WithNewTestNamespace(t, func(ns string) {
-		Expect(Kamel("install", "-n", ns, "--global", "--force").Execute()).To(Succeed())
+	test := func(operatorNamespace string) {
+		Expect(Kamel("install", "-n", operatorNamespace, "--global", "--force").Execute()).To(Succeed())
 
-		Expect(CreateTimerKamelet(ns, "my-own-timer-source")()).To(Succeed())
+		Expect(CreateTimerKamelet(operatorNamespace, "my-own-timer-source")()).To(Succeed())
 
 		// NS2: namespace without operator
 		WithNewTestNamespace(t, func(ns2 string) {
@@ -61,6 +61,17 @@ func TestRunGlobalKamelet(t *testing.T) {
 			Expect(Kamel("delete", "--all", "-n", ns2).Execute()).To(Succeed())
 		})
 
-		Expect(Kamel("uninstall", "-n", ns, "--skip-cluster-roles=false", "--skip-cluster-role-bindings=false").Execute()).To(Succeed())
-	})
+		Expect(Kamel("uninstall", "-n", operatorNamespace, "--skip-crd", "--skip-cluster-roles=false", "--skip-cluster-role-bindings=false").Execute()).To(Succeed())
+	}
+
+	ocp, err := openshift.IsOpenShift(TestClient())
+	assert.Nil(t, err)
+	if ocp {
+		// global operators are always installed in the openshift-operators namespace
+		RegisterTestingT(t)
+		test("openshift-operators")
+	}else {
+		// create new namespace for the global operator
+		WithNewTestNamespace(t, test)
+	}
 }