Skip to content

Commit 077d303

Browse files
Introduce WorkloadKubernetesVersion field to ClusterctlUpgradeSpecInput
1 parent fbf2406 commit 077d303

File tree

6 files changed

+22
-9
lines changed

6 files changed

+22
-9
lines changed

.github/ISSUE_TEMPLATE/kubernetes_bump.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ changes should be cherry-picked to all release series that will support the new
2828
* Ensure the latest available kind version is used (including the latest images for this kind release)
2929
* Verify the quickstart manually
3030
* Prior art: #7156
31-
* bump `InitWithKubernetesVersion` in `clusterctl_upgrade_test.go`
31+
* bump `InitWithKubernetesVersion` and `WorkloadKubernetesVersion` in `clusterctl_upgrade_test.go`
3232
* [ ] Ensure the jobs are adjusted to provide test coverage according to our [support policy](https://cluster-api.sigs.k8s.io/reference/versions.html#supported-kubernetes-versions):
3333
* For the main branch and the release branch of the latest supported Cluster API minor release:
3434
* Add new periodic upgrade job.

docs/book/src/developer/providers/migrations/v1.3-to-v1.4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ maintainers of providers and consumers of our Go API.
7575
For more information, please see: https://github.com/kubernetes/enhancements/issues/2845
7676
- A new `KCPRemediationSpec` test has been added providing better test coverage for KCP remediation most common use cases. As a consequence `MachineRemediationSpec` has been renamed to `MachineDeploymentRemediationSpec` and now only tests remediation of worker machines (NOTE: we plan to improve this test as well in a future iteration).
7777
- Package `test/infrastructure/docker/internal/third_party/forked/loadbalancer` has been moved to `test/infrastructure/docker/internal/loadbalancer` to allow it to diverge from the upstream Kind package.
78-
-
78+
7979
### Suggested changes for providers
8080

8181
- Providers should add an explicit security context to their controllers deployment, see [#7831](https://github.com/kubernetes-sigs/cluster-api/pull/7831) for reference.

docs/book/src/developer/providers/migrations/v1.4-to-v1.5.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ maintainers of providers and consumers of our Go API.
3030
### Other
3131

3232
- clusterctl move is adding the new annotation `clusterctl.cluster.x-k8s.io/delete-for-move` before object deletion.
33+
- Providers running CAPI release-0.3 clusterctl upgrade tests should set `WorkloadKubernetesVersion` field to the maximum workload cluster kubernetes version supported by the old providers in `ClusterctlUpgradeSpecInput`. For more information, please see: https://github.com/kubernetes-sigs/cluster-api/pull/8518#issuecomment-1508064859
3334

3435
### Suggested changes for providers
3536

docs/release/release-tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ This comes down to changing occurrences of the old version to the new version, e
110110
we use in the clusterctl upgrade tests (as of today `cluster-template` and `cluster-template-topology`).
111111
2. Remove old folders that are not used anymore (for `v1.4` we don't have to remove any).
112112
5. Modify the test specs in `test/e2e/clusterctl_upgrade_test.go` (according to the versions we want to test described above).
113-
Please note that `InitWithKubernetesVersion` should be the highest mgmt cluster version supported by the respective Cluster API version.
113+
Please note that both `InitWithKubernetesVersion` and `WorkloadKubernetesVersion` should be the highest mgmt cluster version supported by the respective Cluster API version.
114114
2. Update `create-local-repository.py` and `tools/tilt-prepare/main.go`: `v1.3.99` => `v1.4.99`.
115115
3. Make sure all tests are green (also run `pull-cluster-api-e2e-full-main` and `pull-cluster-api-e2e-workload-upgrade-1-23-latest-main`).
116116

test/e2e/clusterctl_upgrade.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ type ClusterctlUpgradeSpecInput struct {
105105
MgmtFlavor string
106106
CNIManifestPath string
107107
WorkloadFlavor string
108+
// WorkloadKubernetesVersion is Kubernetes version used to create the workload cluster, e.g. `v1.25.0`
109+
WorkloadKubernetesVersion string
108110
// Custom providers can be specified to upgrade to a pre-release or a custom version instead of upgrading to the latest using contact
109111
CoreProvider string
110112
BootstrapProviders []string
@@ -328,7 +330,10 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
328330
// so we are getting a template using the downloaded version of clusterctl, applying it, and wait for machines to be provisioned.
329331

330332
workLoadClusterName = fmt.Sprintf("%s-%s", specName, util.RandomString(6))
331-
kubernetesVersion := input.E2EConfig.GetVariable(KubernetesVersion)
333+
kubernetesVersion := input.WorkloadKubernetesVersion
334+
if kubernetesVersion == "" {
335+
kubernetesVersion = input.E2EConfig.GetVariable(KubernetesVersion)
336+
}
332337
controlPlaneMachineCount := pointer.Int64(1)
333338
workerMachineCount := pointer.Int64(1)
334339

test/e2e/clusterctl_upgrade_test.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ var _ = Describe("When testing clusterctl upgrades (v0.3=>current)", func() {
3636
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.3.25/clusterctl-{OS}-{ARCH}",
3737
InitWithProvidersContract: "v1alpha3",
3838
// CAPI v0.3.x does not work on Kubernetes >= v1.22.
39-
InitWithKubernetesVersion: "v1.21.12",
39+
InitWithKubernetesVersion: "v1.21.14",
40+
WorkloadKubernetesVersion: "v1.22.17",
4041
// CAPI does not work with Kubernetes < v1.22 if ClusterClass is enabled, so we have to disable it.
4142
UpgradeClusterctlVariables: map[string]string{
4243
"CLUSTER_TOPOLOGY": "false",
@@ -68,7 +69,8 @@ var _ = Describe("When testing clusterctl upgrades (v0.4=>current)", func() {
6869
SkipCleanup: skipCleanup,
6970
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.8/clusterctl-{OS}-{ARCH}",
7071
InitWithProvidersContract: "v1alpha4",
71-
InitWithKubernetesVersion: "v1.23.13",
72+
InitWithKubernetesVersion: "v1.23.17",
73+
WorkloadKubernetesVersion: "v1.23.17",
7274
MgmtFlavor: "topology",
7375
WorkloadFlavor: "",
7476
// This check ensures that ownerReference apiVersions are updated for all types after the upgrade.
@@ -105,7 +107,8 @@ var _ = Describe("When testing clusterctl upgrades (v1.0=>current)", func() {
105107
// runtime extension providers. If we don't do this the test will automatically
106108
// try to deploy the latest version of our test-extension from docker.yaml.
107109
InitWithRuntimeExtensionProviders: []string{},
108-
InitWithKubernetesVersion: "v1.23.13",
110+
InitWithKubernetesVersion: "v1.23.17",
111+
WorkloadKubernetesVersion: "v1.23.17",
109112
MgmtFlavor: "topology",
110113
WorkloadFlavor: "",
111114
// This check ensures that ownerReference apiVersions are updated for all types after the upgrade.
@@ -143,7 +146,8 @@ var _ = Describe("When testing clusterctl upgrades (v1.3=>current)", func() {
143146
// try to deploy the latest version of our test-extension from docker.yaml.
144147
InitWithRuntimeExtensionProviders: []string{},
145148
InitWithProvidersContract: "v1beta1",
146-
InitWithKubernetesVersion: "v1.26.0",
149+
InitWithKubernetesVersion: "v1.26.3",
150+
WorkloadKubernetesVersion: "v1.26.3",
147151
MgmtFlavor: "topology",
148152
WorkloadFlavor: "",
149153
// This check ensures that ownerReference apiVersions are updated for all types after the upgrade.
@@ -181,7 +185,8 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.3=>cur
181185
// try to deploy the latest version of our test-extension from docker.yaml.
182186
InitWithRuntimeExtensionProviders: []string{},
183187
InitWithProvidersContract: "v1beta1",
184-
InitWithKubernetesVersion: "v1.26.0",
188+
InitWithKubernetesVersion: "v1.26.3",
189+
WorkloadKubernetesVersion: "v1.26.3",
185190
MgmtFlavor: "topology",
186191
WorkloadFlavor: "topology",
187192
// This check ensures that ownerReference apiVersions are updated for all types after the upgrade.
@@ -210,6 +215,7 @@ var _ = Describe("When testing clusterctl upgrades (v1.4=>current)", func() {
210215
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.0/clusterctl-{OS}-{ARCH}",
211216
InitWithProvidersContract: "v1beta1",
212217
InitWithKubernetesVersion: "v1.27.0",
218+
WorkloadKubernetesVersion: "v1.27.0",
213219
MgmtFlavor: "topology",
214220
WorkloadFlavor: "",
215221
// This check ensures that ownerReference apiVersions are updated for all types after the upgrade.
@@ -238,6 +244,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.4=>cur
238244
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.0/clusterctl-{OS}-{ARCH}",
239245
InitWithProvidersContract: "v1beta1",
240246
InitWithKubernetesVersion: "v1.27.0",
247+
WorkloadKubernetesVersion: "v1.27.0",
241248
MgmtFlavor: "topology",
242249
WorkloadFlavor: "topology",
243250
// This check ensures that ownerReference apiVersions are updated for all types after the upgrade.

0 commit comments

Comments
 (0)