diff --git a/Makefile b/Makefile index 8d1184b2e..26b7b8424 100644 --- a/Makefile +++ b/Makefile @@ -169,7 +169,7 @@ test: $(SETUP_ENVTEST) ## Run unit and integration tests KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test ./... $(TEST_ARGS) # Allow overriding the e2e configurations -GINKGO_FOCUS ?= Workload cluster creation +GINKGO_FOCUS ?= Workload cluster creation|GKE workload cluster creation GINKGO_SKIP ?= API Version Upgrade GINKGO_NODES ?= 1 GINKGO_NOCOLOR ?= false diff --git a/test/e2e/config/gcp-ci.yaml b/test/e2e/config/gcp-ci.yaml index 23057345e..ac8de8e7d 100644 --- a/test/e2e/config/gcp-ci.yaml +++ b/test/e2e/config/gcp-ci.yaml @@ -79,6 +79,7 @@ providers: variables: KUBERNETES_VERSION: "v1.32.5" KUBERNETES_VERSION_MANAGEMENT: "v1.32.5" + KUBERNETES_VERSION_GKE: "v1.32.4" ETCD_VERSION_UPGRADE_TO: "3.5.16-0" COREDNS_VERSION_UPGRADE_TO: "v1.11.3" KUBERNETES_IMAGE_UPGRADE_FROM: "projects/k8s-staging-cluster-api-gcp/global/images/cluster-api-ubuntu-2204-v1-32-5-nightly" diff --git a/test/e2e/data/infrastructure-gcp/cluster-template-ci-gke.yaml b/test/e2e/data/infrastructure-gcp/cluster-template-ci-gke.yaml index 72c9d4108..61ac5f3f4 100644 --- a/test/e2e/data/infrastructure-gcp/cluster-template-ci-gke.yaml +++ b/test/e2e/data/infrastructure-gcp/cluster-template-ci-gke.yaml @@ -33,7 +33,7 @@ metadata: spec: project: "${GCP_PROJECT}" location: "${GCP_REGION}" - version: "${KUBERNETES_VERSION}" + version: "${KUBERNETES_VERSION_GKE}" releaseChannel: "regular" --- apiVersion: cluster.x-k8s.io/v1beta1 diff --git a/test/e2e/data/infrastructure-gcp/cluster-template-kcp-remediation.yaml b/test/e2e/data/infrastructure-gcp/cluster-template-kcp-remediation.yaml index 1e2d03a92..ea2923113 100644 --- a/test/e2e/data/infrastructure-gcp/cluster-template-kcp-remediation.yaml +++ b/test/e2e/data/infrastructure-gcp/cluster-template-kcp-remediation.yaml @@ -54,7 +54,7 @@ spec: extraArgs: cloud-provider: external allocate-node-cidrs: "false" - kubernetesVersion: "${KUBERNETES_VERSION}" + kubernetesVersion: "${KUBERNETES_VERSION_GKE}" files: - content: | [Global] diff --git a/test/e2e/e2e_gke_test.go b/test/e2e/e2e_gke_test.go index 78e6ec53e..61e47b901 100644 --- a/test/e2e/e2e_gke_test.go +++ b/test/e2e/e2e_gke_test.go @@ -45,7 +45,7 @@ var _ = Describe("GKE workload cluster creation", func() { namespace *corev1.Namespace cancelWatches context.CancelFunc result *ApplyManagedClusterTemplateAndWaitResult - clusterName string + clusterNamePrefix string clusterctlLogFolder string ) @@ -57,7 +57,7 @@ var _ = Describe("GKE workload cluster creation", func() { Expect(e2eConfig.Variables).To(HaveKey(KubernetesVersion)) - clusterName = fmt.Sprintf("capg-e2e-%s", util.RandomString(6)) + clusterNamePrefix = fmt.Sprintf("capg-e2e-gke-%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) @@ -86,6 +86,7 @@ var _ = Describe("GKE workload cluster creation", func() { Context("Creating a GKE cluster without autopilot", func() { It("Should create a cluster with 1 machine pool and scale", func() { + clusterName := fmt.Sprintf("%s-single", clusterNamePrefix) By("Initializes with 1 machine pool") minPoolSize, ok := e2eConfig.Variables["GKE_MACHINE_POOL_MIN"] @@ -103,7 +104,7 @@ var _ = Describe("GKE workload cluster creation", func() { Flavor: "ci-gke", Namespace: namespace.Name, ClusterName: clusterName, - KubernetesVersion: e2eConfig.MustGetVariable(KubernetesVersion), + KubernetesVersion: e2eConfig.MustGetVariable(KubernetesVersionGKE), ControlPlaneMachineCount: ptr.To[int64](1), WorkerMachineCount: ptr.To[int64](3), ClusterctlVariables: map[string]string{ @@ -138,6 +139,7 @@ var _ = Describe("GKE workload cluster creation", func() { Context("Creating a GKE cluster with autopilot", func() { It("Should create a cluster with 1 machine pool and scale", func() { + clusterName := fmt.Sprintf("%s-autopilot", clusterNamePrefix) By("Initializes with 1 machine pool") ApplyManagedClusterTemplateAndWait(ctx, ApplyManagedClusterTemplateAndWaitInput{ @@ -163,6 +165,7 @@ var _ = Describe("GKE workload cluster creation", func() { Context("Creating a GKE cluster with custom subnet", func() { It("Should create a cluster with 3 machine pool and custom subnet", func() { + clusterName := fmt.Sprintf("%s-custom-subnet", clusterNamePrefix) By("Initializes with 3 machine pool") ApplyManagedClusterTemplateAndWait(ctx, ApplyManagedClusterTemplateAndWaitInput{ diff --git a/test/e2e/suite_test.go b/test/e2e/suite_test.go index a205785d5..0895885b7 100644 --- a/test/e2e/suite_test.go +++ b/test/e2e/suite_test.go @@ -45,6 +45,7 @@ import ( const ( KubernetesVersion = "KUBERNETES_VERSION" KubernetesVersionManagement = "KUBERNETES_VERSION_MANAGEMENT" + KubernetesVersionGKE = "KUBERNETES_VERSION_GKE" CNIPath = "CNI" CNIResources = "CNI_RESOURCES"