Skip to content

Commit dd33d16

Browse files
committed
test: use unique cluster name to avoid collisions
Signed-off-by: Carlos Salas <[email protected]>
1 parent 71f39ce commit dd33d16

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/e2e/e2e_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var _ = Describe("Workload cluster creation", func() {
4040
namespace *corev1.Namespace
4141
cancelWatches context.CancelFunc
4242
result *clusterctl.ApplyClusterTemplateAndWaitResult
43-
clusterName string
43+
clusterNamePrefix string
4444
clusterctlLogFolder string
4545
)
4646

@@ -52,7 +52,7 @@ var _ = Describe("Workload cluster creation", func() {
5252

5353
Expect(e2eConfig.Variables).To(HaveKey(KubernetesVersion))
5454

55-
clusterName = fmt.Sprintf("capg-e2e-%s", util.RandomString(6))
55+
clusterNamePrefix = fmt.Sprintf("capg-e2e-%s", util.RandomString(6))
5656

5757
// Setup a Namespace where to host objects for this spec and create a watcher for the namespace events.
5858
namespace, cancelWatches = setupSpecNamespace(ctx, specName, bootstrapClusterProxy, artifactFolder)
@@ -79,6 +79,7 @@ var _ = Describe("Workload cluster creation", func() {
7979
})
8080

8181
Context("Creating a single control-plane cluster", func() {
82+
clusterName := fmt.Sprintf("%s-single", clusterNamePrefix)
8283
It("Should create a cluster with 1 worker node and can be scaled", func() {
8384
By("Initializes with 1 worker node")
8485
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
@@ -123,6 +124,7 @@ var _ = Describe("Workload cluster creation", func() {
123124
})
124125

125126
Context("Creating a highly available control-plane cluster", func() {
127+
clusterName := fmt.Sprintf("%s-ha", clusterNamePrefix)
126128
It("Should create a cluster with 3 control-plane and 2 worker nodes", func() {
127129
By("Creating a high available cluster")
128130
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
@@ -147,6 +149,7 @@ var _ = Describe("Workload cluster creation", func() {
147149
})
148150

149151
Context("Creating a single control-plane cluster with per cluster credentials", func() {
152+
clusterName := fmt.Sprintf("%s-with-creds", clusterNamePrefix)
150153
It("Should create a cluster with 1 worker node", func() {
151154
By("Create the credentials secret")
152155

@@ -184,6 +187,7 @@ var _ = Describe("Workload cluster creation", func() {
184187
})
185188

186189
Context("Creating a control-plane cluster with an internal load balancer", func() {
190+
clusterName := fmt.Sprintf("%s-internal-lb", clusterNamePrefix)
187191
It("Should create a cluster with 1 control-plane and 1 worker node with an internal load balancer", func() {
188192
By("Creating a cluster with internal load balancer")
189193
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
@@ -208,6 +212,7 @@ var _ = Describe("Workload cluster creation", func() {
208212
})
209213

210214
Context("Creating a cluster using a cluster class", func() {
215+
clusterName := fmt.Sprintf("%s-topology", clusterNamePrefix)
211216
It("Should create a cluster class and then a cluster based on it", func() {
212217
By("Creating a cluster from a topology")
213218
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{

0 commit comments

Comments
 (0)