Skip to content

Commit 062cad8

Browse files
committed
Make specName constant in e2e tests
1 parent fd9039c commit 062cad8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/e2e/suites/e2e/e2e_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ import (
4646
"sigs.k8s.io/cluster-api-provider-openstack/test/e2e/shared"
4747
)
4848

49+
const specName = "e2e"
50+
4951
var _ = Describe("e2e tests", func() {
5052
var (
5153
namespace *corev1.Namespace
5254
ctx context.Context
53-
specName = "e2e"
5455
)
5556

5657
BeforeEach(func() {
@@ -71,7 +72,7 @@ var _ = Describe("e2e tests", func() {
7172
configCluster.ControlPlaneMachineCount = pointer.Int64Ptr(3)
7273
configCluster.WorkerMachineCount = pointer.Int64Ptr(1)
7374
configCluster.Flavor = shared.FlavorDefault
74-
md := createCluster(ctx, configCluster, specName)
75+
md := createCluster(ctx, configCluster)
7576

7677
workerMachines := framework.GetMachinesByMachineDeployments(ctx, framework.GetMachinesByMachineDeploymentsInput{
7778
Lister: e2eCtx.Environment.BootstrapClusterProxy.GetClient(),
@@ -97,7 +98,7 @@ var _ = Describe("e2e tests", func() {
9798
configCluster.ControlPlaneMachineCount = pointer.Int64Ptr(1)
9899
configCluster.WorkerMachineCount = pointer.Int64Ptr(1)
99100
configCluster.Flavor = shared.FlavorExternalCloudProvider
100-
md := createCluster(ctx, configCluster, specName)
101+
md := createCluster(ctx, configCluster)
101102

102103
workerMachines := framework.GetMachinesByMachineDeployments(ctx, framework.GetMachinesByMachineDeploymentsInput{
103104
Lister: e2eCtx.Environment.BootstrapClusterProxy.GetClient(),
@@ -138,7 +139,7 @@ var _ = Describe("e2e tests", func() {
138139
configCluster.ControlPlaneMachineCount = pointer.Int64Ptr(1)
139140
configCluster.WorkerMachineCount = pointer.Int64Ptr(1)
140141
configCluster.Flavor = shared.FlavorWithoutLB
141-
_ = createCluster(ctx, configCluster, specName)
142+
_ = createCluster(ctx, configCluster)
142143

143144
shared.Byf("Creating MachineDeployment with custom port options")
144145
md3Name := clusterName + "-md-3"
@@ -174,7 +175,7 @@ var _ = Describe("e2e tests", func() {
174175
configCluster.ControlPlaneMachineCount = pointer.Int64Ptr(1)
175176
configCluster.WorkerMachineCount = pointer.Int64Ptr(1)
176177
configCluster.Flavor = shared.FlavorWithoutLB
177-
md := createCluster(ctx, configCluster, specName)
178+
md := createCluster(ctx, configCluster)
178179

179180
workerMachines := framework.GetMachinesByMachineDeployments(ctx, framework.GetMachinesByMachineDeploymentsInput{
180181
Lister: e2eCtx.Environment.BootstrapClusterProxy.GetClient(),
@@ -200,7 +201,7 @@ var _ = Describe("e2e tests", func() {
200201
configCluster.ControlPlaneMachineCount = pointer.Int64Ptr(1)
201202
configCluster.WorkerMachineCount = pointer.Int64Ptr(0)
202203
configCluster.Flavor = shared.FlavorDefault
203-
_ = createCluster(ctx, configCluster, specName)
204+
_ = createCluster(ctx, configCluster)
204205

205206
shared.Byf("Creating Machine Deployment with invalid subnet id")
206207
md1Name := clusterName + "-md-1"
@@ -243,7 +244,7 @@ var _ = Describe("e2e tests", func() {
243244
})
244245
})
245246

246-
func createCluster(ctx context.Context, configCluster clusterctl.ConfigClusterInput, specName string) []*clusterv1.MachineDeployment {
247+
func createCluster(ctx context.Context, configCluster clusterctl.ConfigClusterInput) []*clusterv1.MachineDeployment {
247248
result := &clusterctl.ApplyClusterTemplateAndWaitResult{}
248249
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
249250
ClusterProxy: e2eCtx.Environment.BootstrapClusterProxy,

0 commit comments

Comments
 (0)