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

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


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

commit 99a5ca89cf833d4e3e513f1e382da58383eb65a1
Author: Andrej Smigala <[email protected]>
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)
+       }
 }

Reply via email to