Skip to content

Commit

Permalink
Prepare main branch for v1.12 development
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Büringer [email protected]
  • Loading branch information
sbueringer committed Aug 15, 2024
1 parent bfbf8a4 commit 6c556b5
Show file tree
Hide file tree
Showing 39 changed files with 4,163 additions and 63 deletions.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ generate-doctoc:
TRACE=$(TRACE) ./hack/generate-doctoc.sh

.PHONY: generate-e2e-templates
generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v1.9 v1.10 main) ## Generate test templates for all branches
generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v1.9 v1.10 v1.11 main) ## Generate test templates for all branches

.PHONY: generate-e2e-templates-main
generate-e2e-templates-main: $(KUSTOMIZE) ## Generate test templates for the main branch
Expand Down Expand Up @@ -413,6 +413,15 @@ generate-e2e-templates-main: $(KUSTOMIZE) ## Generate test templates for the mai
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_SUPERVISOR_TEMPLATE_DIR)/main/fast-rollout" > "$(E2E_SUPERVISOR_TEMPLATE_DIR)/main/cluster-template-fast-rollout-supervisor.yaml"
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_SUPERVISOR_TEMPLATE_DIR)/main/ownerrefs-finalizers" > "$(E2E_SUPERVISOR_TEMPLATE_DIR)/main/cluster-template-ownerrefs-finalizers-supervisor.yaml"

.PHONY: generate-e2e-templates-v1.11
generate-e2e-templates-v1.11: $(KUSTOMIZE)
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.11/clusterclass" > "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.11/clusterclass-quick-start.yaml"
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.11/workload" > "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.11/cluster-template-workload.yaml"

"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_SUPERVISOR_TEMPLATE_DIR)/v1.11/clusterclass" > "$(E2E_SUPERVISOR_TEMPLATE_DIR)/v1.11/clusterclass-quick-start-supervisor.yaml"
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_SUPERVISOR_TEMPLATE_DIR)/v1.11/workload" > "$(E2E_SUPERVISOR_TEMPLATE_DIR)/v1.11/cluster-template-workload-supervisor.yaml"


.PHONY: generate-e2e-templates-v1.10
generate-e2e-templates-v1.10: $(KUSTOMIZE)
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.10/clusterclass" > "$(E2E_GOVMOMI_TEMPLATE_DIR)/v1.10/clusterclass-quick-start.yaml"
Expand Down
2 changes: 1 addition & 1 deletion clusterctl-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "infrastructure-vsphere",
"config": {
"componentsFile": "infrastructure-components.yaml",
"nextVersion": "v1.11.99"
"nextVersion": "v1.12.99"
}
}
19 changes: 9 additions & 10 deletions docs/release/release-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,20 @@ is used for e.g. local development and e2e tests. We also modify tests so that t
This comes down to changing occurrences of the old version to the new version, e.g. `v1.10` to `v1.11`:

1. Setup E2E tests for the new release:
1. Goal is that our clusterctl upgrade tests are testing the right versions. For `v1.11` this means:
- v1beta1: `v1.10 => current` (will change with each new release)
- v1beta1: `v1.9 => current` (will change with each new release)
2. Modify the test specs in `test/e2e/clusterctl_upgrade_test.go` (according to the versions we want to test described above).
Please note that both `InitWithKubernetesVersion` and `WorkloadKubernetesVersion` should be the highest mgmt cluster version supported by the respective Cluster API version.
3. Update providers in `vsphere.yaml`:
1. Goal is that we have clusterctl upgrade tests for all relevant upgrade cases:
- Modify the test specs in `test/e2e/clusterctl_upgrade_test.go`. Please note the comments above each test case (look for `This test should be changed during "prepare main branch"`)
Please note that both `InitWithKubernetesVersion` and `WorkloadKubernetesVersion` should be the highest mgmt cluster version supported by the respective Cluster API version.
- Please ping maintainers after these changes are made for a first round of feedback before continuing with the steps below.
2. Update providers in `vsphere.yaml`:
1. Add a new `v1.10` entry.
2. Remove providers that are not used anymore in clusterctl upgrade tests.
3. Change `v1.10.99` to `v1.11.99`.
4. Adjust `metadata.yaml`'s:
3. Adjust `metadata.yaml`'s:
1. Create a new `v1.10` `metadata.yaml` (`test/e2e/data/shared/capv/v1.10/metadata.yaml`) by copying the top-level `metadata.yaml`.
2. Add new release to the top-level `metadata.yaml`
3. Add the new v1.11 release to the main `metadata.yaml` (`test/e2e/data/shared/capv/main/metadata.yaml`).
4. Remove old `metadata.yaml`'s that are not used anymore in clusterctl upgrade tests.
5. Adjust cluster templates in `test/e2e/data/infrastructure-vsphere-govmomi` and `test/e2e/data/infrastructure-vsphere-supervisor`:
4. Adjust cluster templates in `test/e2e/data/infrastructure-vsphere-govmomi` and `test/e2e/data/infrastructure-vsphere-supervisor`:
1. Regenerate templates via `make generate-e2e-templates`.
2. Create a new `v1.10` folder. It should be created based on the `main` folder and only contain the templates
we use in the clusterctl upgrade tests, as of today:
Expand All @@ -48,9 +47,9 @@ This comes down to changing occurrences of the old version to the new version, e
- `workload`
3. Remove old folders that are not used anymore in clusterctl upgrade tests.
4. Add a `generate-e2e-templates-v1.10` target in `Makefile` and remove the old ones.
2. Update `clusterctl-settings.json`: `v1.10.99` => `v1.11.99`.
2. Update `clusterctl-settings.json` and all `tilt-provider.yaml`: `v1.10.99` => `v1.11.99`.
3. Make sure all tests are green.
Prior art: [🌱 Prepare main for development of release v1.11](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/pull/2950)
Prior art: [🌱 Prepare main for development of release v1.12](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/pull/3159)

## Remove previously deprecated code

Expand Down
3 changes: 3 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ releaseSeries:
- major: 1
minor: 11
contract: v1beta1
- major: 1
minor: 12
contract: v1beta1
68 changes: 58 additions & 10 deletions test/e2e/clusterctl_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,19 @@ var (
capvReleaseMarkerPrefix = "go://sigs.k8s.io/cluster-api-provider-vsphere@v%s"
)

var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10=>current, CAPI 1.7=>1.8) [vcsim] [supervisor] [ClusterClass]", func() {
const specName = "clusterctl-upgrade-1.10-current" // prefix (clusterctl-upgrade) copied from CAPI
// Note: This test should be changed during "prepare main branch", it should test CAPV n-1 => current (and then corresponding CAPI versions if already available).
var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.11=>current, CAPI 1.8=>1.8) on K8S latest ci mgmt cluster [vcsim] [supervisor] [ClusterClass]", func() {
const specName = "clusterctl-upgrade-1.11-current-latest-ci" // prefix (clusterctl-upgrade) copied from CAPI
Setup(specName, func(testSpecificSettingsGetter func() testSettings) {
capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput {
capiVersion := "1.7"
capiVersion := "1.8"
capiStableRelease, err := getStableReleaseOfMinor(ctx, capiReleaseMarkerPrefix, capiVersion)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", capiVersion)
capvVersion := "1.10"
capvVersion := "1.11"
capvStableRelease, err := getStableReleaseOfMinor(ctx, capvReleaseMarkerPrefix, capvVersion)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", capvVersion)
initKubernetesVersion, err := kubernetesversions.ResolveVersion(ctx, e2eConfig.GetVariable("KUBERNETES_VERSION_LATEST_CI"))
Expect(err).ToNot(HaveOccurred())
return capi_e2e.ClusterctlUpgradeSpecInput{
E2EConfig: e2eConfig,
ClusterctlConfigPath: testSpecificSettingsGetter().ClusterctlConfigPath,
Expand All @@ -67,8 +70,53 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10
// InitWithKubernetesVersion should be the highest kubernetes version supported by the init Cluster API version.
// This is to guarantee that both, the old and new CAPI version, support the defined version.
// Ensure all Kubernetes versions used here are covered in patch-vsphere-template.yaml
InitWithKubernetesVersion: "v1.30.0",
WorkloadKubernetesVersion: "v1.30.0",
InitWithKubernetesVersion: initKubernetesVersion,
WorkloadKubernetesVersion: "v1.31.0",
WorkloadFlavor: testSpecificSettingsGetter().FlavorForMode("workload"),
// We are using a separate management cluster. For running in VCSim we also have to pass WithAdditionalVCSimServer
// below otherwise there will be no VCSim instance created in the management cluster.
UseKindForManagementCluster: true,
KindManagementClusterNewClusterProxyFunc: kindManagementClusterNewClusterProxyFunc,
}
})
},
WithIP("WORKLOAD_CONTROL_PLANE_ENDPOINT_IP"),
// This is required because we are using a separate management cluster with kind by passing `UseKindForManagementCluster` above.
WithAdditionalVCSimServer(true),
)
})

// Note: This test should be changed during "prepare main branch", it should test CAPV n-1 => current (and then corresponding CAPI versions if already available).
var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.11=>current, CAPI 1.8=>1.8) [vcsim] [supervisor] [ClusterClass]", func() {
const specName = "clusterctl-upgrade-1.11-current" // prefix (clusterctl-upgrade) copied from CAPI
Setup(specName, func(testSpecificSettingsGetter func() testSettings) {
capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput {
capiVersion := "1.8"
capiStableRelease, err := getStableReleaseOfMinor(ctx, capiReleaseMarkerPrefix, capiVersion)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", capiVersion)
capvVersion := "1.11"
capvStableRelease, err := getStableReleaseOfMinor(ctx, capvReleaseMarkerPrefix, capvVersion)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", capvVersion)
return capi_e2e.ClusterctlUpgradeSpecInput{
E2EConfig: e2eConfig,
ClusterctlConfigPath: testSpecificSettingsGetter().ClusterctlConfigPath,
BootstrapClusterProxy: bootstrapClusterProxy,
ArtifactFolder: artifactFolder,
SkipCleanup: skipCleanup,
MgmtFlavor: testSpecificSettingsGetter().FlavorForMode("topology"),
PostNamespaceCreated: testSpecificSettingsGetter().PostNamespaceCreatedFunc,
InitWithBinary: fmt.Sprintf(clusterctlDownloadURL, capiStableRelease),
InitWithCoreProvider: fmt.Sprintf(providerCAPIPrefix, capiStableRelease),
InitWithBootstrapProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithControlPlaneProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithInfrastructureProviders: []string{fmt.Sprintf(providerVSpherePrefix, capvStableRelease)},
InitWithRuntimeExtensionProviders: testSpecificSettingsGetter().RuntimeExtensionProviders,
InitWithIPAMProviders: []string{},
// InitWithKubernetesVersion should be the highest kubernetes version supported by the init Cluster API version.
// This is to guarantee that both, the old and new CAPI version, support the defined version.
// Ensure all Kubernetes versions used here are covered in patch-vsphere-template.yaml
InitWithKubernetesVersion: "v1.31.0",
WorkloadKubernetesVersion: "v1.31.0",
WorkloadFlavor: testSpecificSettingsGetter().FlavorForMode("workload"),
// We are using a separate management cluster. For running in VCSim we also have to pass WithAdditionalVCSimServer
// below otherwise there will be no VCSim instance created in the management cluster.
Expand All @@ -83,7 +131,8 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10
)
})

var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10=>current, CAPI 1.7=>1.8) on K8S latest ci mgmt cluster [vcsim] [supervisor] [ClusterClass]", func() {
// Note: This test should be changed during "prepare main branch", it should test CAPV n-2 => current (and then corresponding CAPI versions if already available).
var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10=>current, CAPI 1.7=>1.8) [vcsim] [supervisor] [ClusterClass]", func() {
const specName = "clusterctl-upgrade-1.10-current" // prefix (clusterctl-upgrade) copied from CAPI
Setup(specName, func(testSpecificSettingsGetter func() testSettings) {
capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput {
Expand All @@ -93,8 +142,6 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10
capvVersion := "1.10"
capvStableRelease, err := getStableReleaseOfMinor(ctx, capvReleaseMarkerPrefix, capvVersion)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for minor release : %s", capvVersion)
initKubernetesVersion, err := kubernetesversions.ResolveVersion(ctx, e2eConfig.GetVariable("KUBERNETES_VERSION_LATEST_CI"))
Expect(err).ToNot(HaveOccurred())
return capi_e2e.ClusterctlUpgradeSpecInput{
E2EConfig: e2eConfig,
ClusterctlConfigPath: testSpecificSettingsGetter().ClusterctlConfigPath,
Expand All @@ -113,7 +160,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10
// InitWithKubernetesVersion should be the highest kubernetes version supported by the init Cluster API version.
// This is to guarantee that both, the old and new CAPI version, support the defined version.
// Ensure all Kubernetes versions used here are covered in patch-vsphere-template.yaml
InitWithKubernetesVersion: initKubernetesVersion,
InitWithKubernetesVersion: "v1.30.0",
WorkloadKubernetesVersion: "v1.30.0",
WorkloadFlavor: testSpecificSettingsGetter().FlavorForMode("workload"),
// We are using a separate management cluster. For running in VCSim we also have to pass WithAdditionalVCSimServer
Expand All @@ -129,6 +176,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10
)
})

// Note: This test should be changed during "prepare main branch", it should test CAPV n-3 => current (and then corresponding CAPI versions if already available).
var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9=>current, CAPI 1.6=>1.8) [vcsim] [supervisor] [ClusterClass]", func() {
const specName = "clusterctl-upgrade-1.9-current" // prefix (clusterctl-upgrade) copied from CAPI
Setup(specName, func(testSpecificSettingsGetter func() testSettings) {
Expand Down
46 changes: 15 additions & 31 deletions test/e2e/config/vsphere.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,6 @@ providers:
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"
- name: "{go://sigs.k8s.io/[email protected]}" # supported release in the v1beta1 series
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/[email protected]}/core-components.yaml"
type: "url"
contract: v1beta1
files:
- sourcePath: "../data/shared/capi/v1.5/metadata.yaml"
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"

- name: kubeadm
type: BootstrapProvider
Expand Down Expand Up @@ -93,15 +84,6 @@ providers:
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"
- name: "{go://sigs.k8s.io/[email protected]}" # supported release in the v1beta1 series
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/[email protected]}/bootstrap-components.yaml"
type: "url"
contract: v1beta1
files:
- sourcePath: "../data/shared/capi/v1.5/metadata.yaml"
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"

- name: kubeadm
type: ControlPlaneProvider
Expand Down Expand Up @@ -133,15 +115,6 @@ providers:
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"
- name: "{go://sigs.k8s.io/[email protected]}" # supported release in the v1beta1 series
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/[email protected]}/control-plane-components.yaml"
type: "url"
contract: v1beta1
files:
- sourcePath: "../data/shared/capi/v1.5/metadata.yaml"
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"

- name: in-cluster
type: IPAMProvider
Expand All @@ -159,7 +132,7 @@ providers:
- name: vsphere
type: InfrastructureProvider
versions:
- name: v1.11.99 # next release
- name: v1.12.99 # next release
# Use manifest from source files
value: ../../../../cluster-api-provider-vsphere/config/default
contract: v1beta1
Expand Down Expand Up @@ -191,6 +164,17 @@ providers:
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-supervisor/main/cluster-template-conformance-supervisor.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-supervisor/main/cluster-template-ownerrefs-finalizers-supervisor.yaml"
- sourcePath: "../data/shared/capv/main/metadata.yaml"
- name: "{go://sigs.k8s.io/[email protected]}" # supported release in the v1beta1 series
value: "https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/{go://sigs.k8s.io/[email protected]}/infrastructure-components.yaml"
type: "url"
contract: v1beta1
files:
# Add a cluster template
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.11/cluster-template-workload.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-govmomi/v1.11/clusterclass-quick-start.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-supervisor/v1.11/cluster-template-workload-supervisor.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere-supervisor/v1.11/clusterclass-quick-start-supervisor.yaml"
- sourcePath: "../data/shared/capv/v1.11/metadata.yaml"
- name: "{go://sigs.k8s.io/[email protected]}" # supported release in the v1beta1 series
value: "https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/{go://sigs.k8s.io/[email protected]}/infrastructure-components.yaml"
type: "url"
Expand All @@ -217,7 +201,7 @@ providers:
- name: vcsim
type: RuntimeExtensionProvider # vcsim isn't a provider, but we fake it is so it can be handled by the clusterctl machinery.
versions:
- name: v1.11.99
- name: v1.12.99
# Use manifest from source files
value: ../../../../cluster-api-provider-vsphere/test/infrastructure/vcsim/config/default
contract: v1beta1
Expand All @@ -242,7 +226,7 @@ providers:
- name: net-operator
type: RuntimeExtensionProvider # net-operator isn't a provider, but we fake it is so it can be handled by the clusterctl machinery.
versions:
- name: v1.11.99
- name: v1.12.99
# Use manifest from source files
value: ../../../../cluster-api-provider-vsphere/test/infrastructure/net-operator/config/default
contract: v1beta1
Expand All @@ -255,7 +239,7 @@ providers:
- name: capv-test-extension
type: RuntimeExtensionProvider
versions:
- name: v1.11.99
- name: v1.12.99
# Use manifest from source files
value: ../../../../cluster-api-provider-vsphere/test/extension/config/default
contract: v1beta1
Expand Down
Loading

0 comments on commit 6c556b5

Please sign in to comment.