diff --git a/test/e2e/cluster_topology_basic_test.go b/test/e2e/cluster_topology_basic_test.go index d4b97e23c9..67eabf032c 100644 --- a/test/e2e/cluster_topology_basic_test.go +++ b/test/e2e/cluster_topology_basic_test.go @@ -65,14 +65,16 @@ var _ = Describe("When creating a cluster with topology with simple workflow", L clusterName = testHelper.generateTestClusterName(specName) Expect(clusterName).NotTo(BeNil()) + targetKubeVer := testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27") + By("Creating a workload cluster with topology") clusterTopologyConfig := NewClusterTopologyConfig( WithName(clusterName), - WithKubernetesVersion(testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27")), + WithKubernetesVersion(targetKubeVer), WithControlPlaneCount(1), WithWorkerNodeCount(1), - WithControlPlaneMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), - WithWorkerMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), + WithControlPlaneMachineTemplateImage(targetKubeVer), + WithWorkerMachineTemplateImage(targetKubeVer), ) clusterResources, err := nutanixE2ETest.CreateCluster(ctx, clusterTopologyConfig) @@ -82,7 +84,7 @@ var _ = Describe("When creating a cluster with topology with simple workflow", L cluster = clusterResources.Cluster By("Waiting until nodes are ready") - nutanixE2ETest.WaitForNodesReady(ctx, testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27"), clusterResources) + nutanixE2ETest.WaitForNodesReady(ctx, targetKubeVer, clusterResources) By("PASSED!") }) @@ -91,14 +93,16 @@ var _ = Describe("When creating a cluster with topology with simple workflow", L clusterName = testHelper.generateTestClusterName(specName) Expect(clusterName).NotTo(BeNil()) + targetKubeVer := testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_28") + By("Creating a workload cluster with topology") clusterTopologyConfig := NewClusterTopologyConfig( WithName(clusterName), - WithKubernetesVersion(testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_28")), + WithKubernetesVersion(targetKubeVer), WithControlPlaneCount(1), WithWorkerNodeCount(1), - WithControlPlaneMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_28")), - WithWorkerMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_28")), + WithControlPlaneMachineTemplateImage(targetKubeVer), + WithWorkerMachineTemplateImage(targetKubeVer), ) clusterResources, err := nutanixE2ETest.CreateCluster(ctx, clusterTopologyConfig) @@ -108,7 +112,7 @@ var _ = Describe("When creating a cluster with topology with simple workflow", L cluster = clusterResources.Cluster By("Waiting until nodes are ready") - nutanixE2ETest.WaitForNodesReady(ctx, testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_28"), clusterResources) + nutanixE2ETest.WaitForNodesReady(ctx, targetKubeVer, clusterResources) By("PASSED!") }) @@ -117,14 +121,16 @@ var _ = Describe("When creating a cluster with topology with simple workflow", L clusterName = testHelper.generateTestClusterName(specName) Expect(clusterName).NotTo(BeNil()) + targetKubeVer := testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_29") + By("Creating a workload cluster with topology") clusterTopologyConfig := NewClusterTopologyConfig( WithName(clusterName), - WithKubernetesVersion(testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_29")), + WithKubernetesVersion(targetKubeVer), WithControlPlaneCount(1), WithWorkerNodeCount(1), - WithControlPlaneMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_29")), - WithWorkerMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_29")), + WithControlPlaneMachineTemplateImage(targetKubeVer), + WithWorkerMachineTemplateImage(targetKubeVer), ) clusterResources, err := nutanixE2ETest.CreateCluster(ctx, clusterTopologyConfig) @@ -134,7 +140,7 @@ var _ = Describe("When creating a cluster with topology with simple workflow", L cluster = clusterResources.Cluster By("Waiting until nodes are ready") - nutanixE2ETest.WaitForNodesReady(ctx, testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_29"), clusterResources) + nutanixE2ETest.WaitForNodesReady(ctx, targetKubeVer, clusterResources) By("PASSED!") }) diff --git a/test/e2e/cluster_topology_scale_out_test.go b/test/e2e/cluster_topology_scale_out_test.go index f642aed58f..59cb84f0ec 100644 --- a/test/e2e/cluster_topology_scale_out_test.go +++ b/test/e2e/cluster_topology_scale_out_test.go @@ -32,11 +32,11 @@ var _ = Describe("When scaling out cluster with topology ", Label("clusterclass" const flavor = "topology" var ( - namespace *corev1.Namespace - clusterName string - cluster *clusterv1.Cluster - cancelWatches context.CancelFunc - testHelper testHelperInterface + namespace *corev1.Namespace + clusterName string + cluster *clusterv1.Cluster + cancelWatches context.CancelFunc + testHelper testHelperInterface nutanixE2ETest *NutanixE2ETest ) @@ -61,18 +61,20 @@ var _ = Describe("When scaling out cluster with topology ", Label("clusterclass" dumpSpecResourcesAndCleanup(ctx, specName, bootstrapClusterProxy, artifactFolder, namespace, cancelWatches, cluster, e2eConfig.GetIntervals, skipCleanup) }) - It("Scale out a cluster with topology from 1 CP node to 3 CP nodes", func() { + It("Scale out a cluster with topology from 1 CP node to 3 CP nodes with Kube127", func() { clusterName = testHelper.generateTestClusterName(specName) Expect(clusterName).NotTo(BeNil()) + targetKubeVer := testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27") + By("Creating a workload cluster with topology") clusterTopologyConfig := NewClusterTopologyConfig( WithName(clusterName), - WithKubernetesVersion(testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27")), + WithKubernetesVersion(targetKubeVer), WithControlPlaneCount(1), WithWorkerNodeCount(1), - WithControlPlaneMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), - WithWorkerMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), + WithControlPlaneMachineTemplateImage(targetKubeVer), + WithWorkerMachineTemplateImage(targetKubeVer), ) clusterResources, err := nutanixE2ETest.CreateCluster(ctx, clusterTopologyConfig) @@ -82,15 +84,15 @@ var _ = Describe("When scaling out cluster with topology ", Label("clusterclass" cluster = clusterResources.Cluster By("Waiting until nodes are ready") - nutanixE2ETest.WaitForNodesReady(ctx, testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27"), clusterResources) + nutanixE2ETest.WaitForNodesReady(ctx, targetKubeVer, clusterResources) clusterTopologyConfig = NewClusterTopologyConfig( WithName(clusterName), - WithKubernetesVersion(testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27")), + WithKubernetesVersion(targetKubeVer), WithControlPlaneCount(3), WithWorkerNodeCount(1), - WithControlPlaneMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), - WithWorkerMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), + WithControlPlaneMachineTemplateImage(targetKubeVer), + WithWorkerMachineTemplateImage(targetKubeVer), ) clusterResources, err = nutanixE2ETest.UpgradeCluster(ctx, clusterTopologyConfig) @@ -103,23 +105,25 @@ var _ = Describe("When scaling out cluster with topology ", Label("clusterclass" nutanixE2ETest.WaitForMachineDeploymentMachinesToBeUpgraded(ctx, clusterTopologyConfig, clusterResources) By("Waiting until nodes are ready") - nutanixE2ETest.WaitForNodesReady(ctx, testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27"), clusterResources) + nutanixE2ETest.WaitForNodesReady(ctx, targetKubeVer, clusterResources) By("PASSED!") }) - It("Scale out a cluster with topology from 1 Worker node to 3 Worker nodes", func() { + It("Scale out a cluster with topology from 1 Worker node to 3 Worker nodes with Kube127", func() { clusterName = testHelper.generateTestClusterName(specName) Expect(clusterName).NotTo(BeNil()) + targetKubeVer := testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27") + By("Creating a workload cluster with topology") clusterTopologyConfig := NewClusterTopologyConfig( WithName(clusterName), - WithKubernetesVersion(testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27")), + WithKubernetesVersion(targetKubeVer), WithControlPlaneCount(1), WithWorkerNodeCount(1), - WithControlPlaneMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), - WithWorkerMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), + WithControlPlaneMachineTemplateImage(targetKubeVer), + WithWorkerMachineTemplateImage(targetKubeVer), ) clusterResources, err := nutanixE2ETest.CreateCluster(ctx, clusterTopologyConfig) @@ -129,15 +133,15 @@ var _ = Describe("When scaling out cluster with topology ", Label("clusterclass" cluster = clusterResources.Cluster By("Waiting until nodes are ready") - nutanixE2ETest.WaitForNodesReady(ctx, testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27"), clusterResources) + nutanixE2ETest.WaitForNodesReady(ctx, targetKubeVer, clusterResources) clusterTopologyConfig = NewClusterTopologyConfig( WithName(clusterName), - WithKubernetesVersion(testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27")), + WithKubernetesVersion(targetKubeVer), WithControlPlaneCount(1), WithWorkerNodeCount(3), - WithControlPlaneMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), - WithWorkerMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), + WithControlPlaneMachineTemplateImage(targetKubeVer), + WithWorkerMachineTemplateImage(targetKubeVer), ) clusterResources, err = nutanixE2ETest.UpgradeCluster(ctx, clusterTopologyConfig) @@ -150,23 +154,25 @@ var _ = Describe("When scaling out cluster with topology ", Label("clusterclass" nutanixE2ETest.WaitForMachineDeploymentMachinesToBeUpgraded(ctx, clusterTopologyConfig, clusterResources) By("Waiting until nodes are ready") - nutanixE2ETest.WaitForNodesReady(ctx, testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27"), clusterResources) + nutanixE2ETest.WaitForNodesReady(ctx, targetKubeVer, clusterResources) By("PASSED!") }) - It("Scale out a cluster with topology from 1 CP and Worker node to 3 CP and Worker nodes", func() { + It("Scale out a cluster with topology from 1 CP and Worker node to 3 CP and Worker nodes with Kube127", func() { clusterName = testHelper.generateTestClusterName(specName) Expect(clusterName).NotTo(BeNil()) + targetKubeVer := testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27") + By("Creating a workload cluster with topology") clusterTopologyConfig := NewClusterTopologyConfig( WithName(clusterName), - WithKubernetesVersion(testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27")), + WithKubernetesVersion(targetKubeVer), WithControlPlaneCount(1), WithWorkerNodeCount(1), - WithControlPlaneMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), - WithWorkerMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), + WithControlPlaneMachineTemplateImage(targetKubeVer), + WithWorkerMachineTemplateImage(targetKubeVer), ) clusterResources, err := nutanixE2ETest.CreateCluster(ctx, clusterTopologyConfig) @@ -176,15 +182,15 @@ var _ = Describe("When scaling out cluster with topology ", Label("clusterclass" cluster = clusterResources.Cluster By("Waiting until nodes are ready") - nutanixE2ETest.WaitForNodesReady(ctx, testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27"), clusterResources) + nutanixE2ETest.WaitForNodesReady(ctx, targetKubeVer, clusterResources) clusterTopologyConfig = NewClusterTopologyConfig( WithName(clusterName), - WithKubernetesVersion(testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27")), + WithKubernetesVersion(targetKubeVer), WithControlPlaneCount(3), WithWorkerNodeCount(3), - WithControlPlaneMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), - WithWorkerMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), + WithControlPlaneMachineTemplateImage(targetKubeVer), + WithWorkerMachineTemplateImage(targetKubeVer), ) clusterResources, err = nutanixE2ETest.UpgradeCluster(ctx, clusterTopologyConfig) @@ -197,7 +203,7 @@ var _ = Describe("When scaling out cluster with topology ", Label("clusterclass" nutanixE2ETest.WaitForMachineDeploymentMachinesToBeUpgraded(ctx, clusterTopologyConfig, clusterResources) By("Waiting until nodes are ready") - nutanixE2ETest.WaitForNodesReady(ctx, testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27"), clusterResources) + nutanixE2ETest.WaitForNodesReady(ctx, targetKubeVer, clusterResources) By("PASSED!") }) diff --git a/test/e2e/cluster_topology_upgrade_test.go b/test/e2e/cluster_topology_upgrade_test.go index 6a024bc123..d0f92c05ce 100644 --- a/test/e2e/cluster_topology_upgrade_test.go +++ b/test/e2e/cluster_topology_upgrade_test.go @@ -32,11 +32,11 @@ var _ = Describe("When upgrading the k8s version of cluster with topology", Labe const flavor = "topology" var ( - namespace *corev1.Namespace - clusterName string - cluster *clusterv1.Cluster - cancelWatches context.CancelFunc - testHelper testHelperInterface + namespace *corev1.Namespace + clusterName string + cluster *clusterv1.Cluster + cancelWatches context.CancelFunc + testHelper testHelperInterface nutanixE2ETest *NutanixE2ETest ) @@ -65,14 +65,17 @@ var _ = Describe("When upgrading the k8s version of cluster with topology", Labe clusterName = testHelper.generateTestClusterName(specName) Expect(clusterName).NotTo(BeNil()) + fromKubeVer := testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27") + toKubeVer := testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_28") + By("Creating a workload cluster with topology") clusterTopologyConfig := NewClusterTopologyConfig( WithName(clusterName), - WithKubernetesVersion(testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27")), + WithKubernetesVersion(fromKubeVer), WithControlPlaneCount(1), WithWorkerNodeCount(1), - WithControlPlaneMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), - WithWorkerMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_27")), + WithControlPlaneMachineTemplateImage(fromKubeVer), + WithWorkerMachineTemplateImage(fromKubeVer), ) clusterResources, err := nutanixE2ETest.CreateCluster(ctx, clusterTopologyConfig) @@ -82,15 +85,15 @@ var _ = Describe("When upgrading the k8s version of cluster with topology", Labe cluster = clusterResources.Cluster By("Waiting until nodes are ready") - nutanixE2ETest.WaitForNodesReady(ctx, testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_27"), clusterResources) + nutanixE2ETest.WaitForNodesReady(ctx, fromKubeVer, clusterResources) clusterTopologyConfig = NewClusterTopologyConfig( WithName(clusterName), - WithKubernetesVersion(testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_28")), + WithKubernetesVersion(toKubeVer), WithControlPlaneCount(1), WithWorkerNodeCount(1), - WithControlPlaneMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_28")), - WithWorkerMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_28")), + WithControlPlaneMachineTemplateImage(toKubeVer), + WithWorkerMachineTemplateImage(toKubeVer), ) clusterResources, err = nutanixE2ETest.UpgradeCluster(ctx, clusterTopologyConfig) @@ -103,7 +106,7 @@ var _ = Describe("When upgrading the k8s version of cluster with topology", Labe nutanixE2ETest.WaitForMachineDeploymentMachinesToBeUpgraded(ctx, clusterTopologyConfig, clusterResources) By("Waiting until nodes are ready") - nutanixE2ETest.WaitForNodesReady(ctx, testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_28"), clusterResources) + nutanixE2ETest.WaitForNodesReady(ctx, toKubeVer, clusterResources) By("PASSED!") }) @@ -112,14 +115,17 @@ var _ = Describe("When upgrading the k8s version of cluster with topology", Labe clusterName = testHelper.generateTestClusterName(specName) Expect(clusterName).NotTo(BeNil()) + fromKubeVer := testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_28") + toKubeVer := testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_29") + By("Creating a workload cluster with topology") clusterTopologyConfig := NewClusterTopologyConfig( WithName(clusterName), - WithKubernetesVersion(testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_28")), + WithKubernetesVersion(fromKubeVer), WithControlPlaneCount(1), WithWorkerNodeCount(1), - WithControlPlaneMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_28")), - WithWorkerMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_28")), + WithControlPlaneMachineTemplateImage(fromKubeVer), + WithWorkerMachineTemplateImage(fromKubeVer), ) clusterResources, err := nutanixE2ETest.CreateCluster(ctx, clusterTopologyConfig) @@ -129,15 +135,15 @@ var _ = Describe("When upgrading the k8s version of cluster with topology", Labe cluster = clusterResources.Cluster By("Waiting until nodes are ready") - nutanixE2ETest.WaitForNodesReady(ctx, testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_28"), clusterResources) + nutanixE2ETest.WaitForNodesReady(ctx, fromKubeVer, clusterResources) clusterTopologyConfig = NewClusterTopologyConfig( WithName(clusterName), - WithKubernetesVersion(testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_29")), + WithKubernetesVersion(toKubeVer), WithControlPlaneCount(1), WithWorkerNodeCount(1), - WithControlPlaneMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_29")), - WithWorkerMachineTemplateImage(testHelper.getVariableFromE2eConfig("NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME_v1_29")), + WithControlPlaneMachineTemplateImage(toKubeVer), + WithWorkerMachineTemplateImage(toKubeVer), ) clusterResources, err = nutanixE2ETest.UpgradeCluster(ctx, clusterTopologyConfig) @@ -150,7 +156,7 @@ var _ = Describe("When upgrading the k8s version of cluster with topology", Labe nutanixE2ETest.WaitForMachineDeploymentMachinesToBeUpgraded(ctx, clusterTopologyConfig, clusterResources) By("Waiting until nodes are ready") - nutanixE2ETest.WaitForNodesReady(ctx, testHelper.getVariableFromE2eConfig("KUBERNETES_VERSION_v1_29"), clusterResources) + nutanixE2ETest.WaitForNodesReady(ctx, toKubeVer, clusterResources) By("PASSED!") })