Skip to content

Commit

Permalink
Add e2e test for upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-demicev committed Oct 31, 2023
1 parent 7ea7149 commit 8ae9dc7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
1 change: 0 additions & 1 deletion test/e2e/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (
const (
KubernetesVersionManagement = "KUBERNETES_VERSION_MANAGEMENT"
KubernetesVersion = "KUBERNETES_VERSION"
KubernetesVersionUpgradeFrom = "KUBERNETES_VERSION_UPGRADE_FROM"
KubernetesVersionUpgradeTo = "KUBERNETES_VERSION_UPGRADE_TO"
CPMachineTemplateUpgradeTo = "CONTROL_PLANE_MACHINE_TEMPLATE_UPGRADE_TO"
WorkersMachineTemplateUpgradeTo = "WORKERS_MACHINE_TEMPLATE_UPGRADE_TO"
Expand Down
7 changes: 3 additions & 4 deletions test/e2e/config/e2e_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,12 @@ providers:
new: "--leader-elect=false"

variables:
KUBERNETES_VERSION_MANAGEMENT: "v1.24.4"
KUBERNETES_VERSION: "v1.24.4"
KUBERNETES_VERSION_MANAGEMENT: "v1.28.0"
KUBERNETES_VERSION: "v1.28.1"
NODE_DRAIN_TIMEOUT: "60s"
CONFORMANCE_WORKER_MACHINE_COUNT: "2"
CONFORMANCE_CONTROL_PLANE_MACHINE_COUNT: "1"
KUBERNETES_VERSION_UPGRADE_TO: "v1.24.2"
KUBERNETES_VERSION_UPGRADE_FROM: "v1.23.8"
KUBERNETES_VERSION_UPGRADE_TO: "v1.28.1"
KUBERNETES_UPGRADE_OCI_IMAGE_ID: "${KUBERNETES_UPGRADE_OCI_IMAGE_ID}"
IP_FAMILY: "IPv4"
EXP_CLUSTER_RESOURCE_SET: "true"
Expand Down
25 changes: 25 additions & 0 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,31 @@ var _ = Describe("Workload cluster creation", func() {
ControlPlane: result.ControlPlane,
}, e2eConfig.GetIntervals(specName, "wait-control-plane")...)

By("Upgrading control plane")
ApplyClusterTemplateAndWait(ctx, ApplyClusterTemplateAndWaitInput{
ClusterProxy: bootstrapClusterProxy,
ConfigCluster: clusterctl.ConfigClusterInput{
LogFolder: clusterctlLogFolder,
ClusterctlConfigPath: clusterctlConfigPath,
KubeconfigPath: bootstrapClusterProxy.GetKubeconfigPath(),
InfrastructureProvider: "docker",
Flavor: "docker",
Namespace: namespace.Name,
ClusterName: clusterName,
KubernetesVersion: e2eConfig.GetVariable(KubernetesVersionUpgradeTo),
ControlPlaneMachineCount: pointer.Int64Ptr(3),
WorkerMachineCount: pointer.Int64Ptr(3),
},
WaitForClusterIntervals: e2eConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: e2eConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: e2eConfig.GetIntervals(specName, "wait-worker-nodes"),
}, result)

WaitForControlPlaneToBeReady(ctx, WaitForControlPlaneToBeReadyInput{
Getter: bootstrapClusterProxy.GetClient(),
ControlPlane: result.ControlPlane,
}, e2eConfig.GetIntervals(specName, "wait-control-plane")...)

// TODO: this can be uncommented when control plane scaling down is working

// By("Scaling control plane nodes to 1")
Expand Down

0 comments on commit 8ae9dc7

Please sign in to comment.