Skip to content

test: use unique cluster name to avoid collisions #1479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var _ = Describe("Workload cluster creation", func() {
namespace *corev1.Namespace
cancelWatches context.CancelFunc
result *clusterctl.ApplyClusterTemplateAndWaitResult
clusterName string
clusterNamePrefix string
clusterctlLogFolder string
)

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

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

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

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

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

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

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

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

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

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