Skip to content

Commit a369469

Browse files
authored
Merge pull request #1479 from salasberryfin/fix-clusterclass-e2e-errors
test: use unique cluster name to avoid collisions
2 parents 71f39ce + f17b52a commit a369469

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

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

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

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

153156
credsFile := os.Getenv("GOOGLE_APPLICATION_CREDENTIALS")
@@ -185,6 +188,7 @@ var _ = Describe("Workload cluster creation", func() {
185188

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

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

0 commit comments

Comments
 (0)