Skip to content

Commit df341e6

Browse files
salasberryfintamalsaha
authored andcommitted
test: use unique cluster name to avoid collisions
Signed-off-by: Carlos Salas <[email protected]>
1 parent cef2ebd commit df341e6

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)
@@ -81,6 +81,7 @@ var _ = Describe("Workload cluster creation", func() {
8181

8282
Context("Creating a single control-plane cluster", func() {
8383
It("Should create a cluster with 1 worker node and can be scaled", func() {
84+
clusterName := fmt.Sprintf("%s-single", clusterNamePrefix)
8485
By("Initializes with 1 worker node")
8586
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
8687
ClusterProxy: bootstrapClusterProxy,
@@ -125,6 +126,7 @@ var _ = Describe("Workload cluster creation", func() {
125126

126127
Context("Creating a highly available control-plane cluster", func() {
127128
It("Should create a cluster with 3 control-plane and 2 worker nodes", func() {
129+
clusterName := fmt.Sprintf("%s-ha", clusterNamePrefix)
128130
By("Creating a high available cluster")
129131
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
130132
ClusterProxy: bootstrapClusterProxy,
@@ -149,6 +151,7 @@ var _ = Describe("Workload cluster creation", func() {
149151

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

154157
credsFile := os.Getenv("GOOGLE_APPLICATION_CREDENTIALS")
@@ -186,6 +189,7 @@ var _ = Describe("Workload cluster creation", func() {
186189

187190
Context("Creating a control-plane cluster with an internal load balancer", func() {
188191
It("Should create a cluster with 1 control-plane and 1 worker node with an internal load balancer", func() {
192+
clusterName := fmt.Sprintf("%s-internal-lb", clusterNamePrefix)
189193
By("Creating a cluster with internal load balancer")
190194
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
191195
ClusterProxy: bootstrapClusterProxy,
@@ -210,6 +214,7 @@ var _ = Describe("Workload cluster creation", func() {
210214

211215
Context("Creating a cluster using a cluster class", func() {
212216
It("Should create a cluster class and then a cluster based on it", func() {
217+
clusterName := fmt.Sprintf("%s-topology", clusterNamePrefix)
213218
By("Creating a cluster from a topology")
214219
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
215220
ClusterProxy: bootstrapClusterProxy,

0 commit comments

Comments
 (0)