Skip to content

Commit ba24e34

Browse files
Avoid specifying platform in the e2e tests (openshift-service-mesh#555)
Sail Operator can automatically discovery the platform (i.e., ocp or k8s) and there is no need to explicitly specify the platform while running the e2e tests. Signed-off-by: Sridhar Gaddam <[email protected]>
1 parent c888339 commit ba24e34

File tree

6 files changed

+3
-31
lines changed

6 files changed

+3
-31
lines changed

tests/e2e/controlplane/control_plane_suite_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
var (
3232
cl client.Client
3333
err error
34-
ocp = env.GetBool("OCP", false)
3534
namespace = common.OperatorNamespace
3635
deploymentName = env.Get("DEPLOYMENT_NAME", "sail-operator")
3736
controlPlaneNamespace = env.Get("CONTROL_PLANE_NS", "istio-system")

tests/e2e/controlplane/control_plane_test.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,10 @@ var _ = Describe("Control Plane Installation", Ordered, func() {
4747
BeforeAll(func(ctx SpecContext) {
4848
Expect(k.CreateNamespace(namespace)).To(Succeed(), "Namespace failed to be created")
4949

50-
extraArg := ""
51-
if ocp {
52-
extraArg = "--set=platform=openshift"
53-
}
54-
5550
if skipDeploy {
5651
Success("Skipping operator installation because it was deployed externally")
5752
} else {
58-
Expect(common.InstallOperatorViaHelm(extraArg)).
53+
Expect(common.InstallOperatorViaHelm()).
5954
To(Succeed(), "Operator failed to be deployed")
6055
}
6156

@@ -333,10 +328,6 @@ spec:
333328
To(Succeed(), "Operator failed to be deleted")
334329
GinkgoWriter.Println("Operator uninstalled")
335330

336-
if ocp {
337-
Success("Skipping deletion of operator namespace to avoid removal of operator container image from internal registry")
338-
return
339-
}
340331
Expect(k.DeleteNamespace(namespace)).To(Succeed(), "Namespace failed to be deleted")
341332
Success("Namespace deleted")
342333
})

tests/e2e/dualstack/dualstack_suite_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
var (
3232
cl client.Client
3333
err error
34-
ocp = env.GetBool("OCP", false)
3534
namespace = common.OperatorNamespace
3635
deploymentName = env.Get("DEPLOYMENT_NAME", "sail-operator")
3736
controlPlaneNamespace = env.Get("CONTROL_PLANE_NS", "istio-system")

tests/e2e/dualstack/dualstack_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,10 @@ var _ = Describe("DualStack configuration ", Ordered, func() {
5151
BeforeAll(func(ctx SpecContext) {
5252
Expect(k.CreateNamespace(namespace)).To(Succeed(), "Namespace failed to be created")
5353

54-
extraArg := ""
55-
if ocp {
56-
extraArg = "--set=platform=openshift"
57-
}
58-
5954
if skipDeploy {
6055
Success("Skipping operator installation because it was deployed externally")
6156
} else {
62-
Expect(common.InstallOperatorViaHelm(extraArg)).
57+
Expect(common.InstallOperatorViaHelm()).
6358
To(Succeed(), "Operator failed to be deployed")
6459
}
6560

tests/e2e/operator/operator_install_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,10 @@ var _ = Describe("Operator", Ordered, func() {
5858
BeforeAll(func() {
5959
Expect(k.CreateNamespace(namespace)).To(Succeed(), "Namespace failed to be created")
6060

61-
extraArg := ""
62-
if ocp {
63-
extraArg = "--set=platform=openshift"
64-
}
65-
6661
if skipDeploy {
6762
Success("Skipping operator installation because it was deployed externally")
6863
} else {
69-
Expect(common.InstallOperatorViaHelm(extraArg)).
64+
Expect(common.InstallOperatorViaHelm()).
7065
To(Succeed(), "Operator failed to be deployed")
7166
}
7267
})

tests/e2e/operator/operator_suite_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030

3131
var (
3232
cl client.Client
33-
ocp = env.GetBool("OCP", false)
3433
skipDeploy = env.GetBool("SKIP_DEPLOY", false)
3534
namespace = common.OperatorNamespace
3635
deploymentName = env.Get("DEPLOYMENT_NAME", "sail-operator")
@@ -56,11 +55,5 @@ func setup() {
5655
cl, err = k8sclient.InitK8sClient("")
5756
Expect(err).NotTo(HaveOccurred())
5857

59-
if ocp {
60-
GinkgoWriter.Println("Running on OCP cluster")
61-
} else {
62-
GinkgoWriter.Println("Running on Kubernetes")
63-
}
64-
6558
k = kubectl.New("clOperator")
6659
}

0 commit comments

Comments
 (0)