diff --git a/Makefile b/Makefile index 739b94cd7b64..8f9d3a47c4ed 100644 --- a/Makefile +++ b/Makefile @@ -504,15 +504,11 @@ generate-modules: ## Run go mod tidy to ensure modules are up to date cd $(TEST_DIR); go mod tidy .PHONY: generate-e2e-templates -generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v0.4 v1.0 v1.3 v1.4 main) ## Generate cluster templates for all versions +generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, v1.0 v1.3 v1.4 main) ## Generate cluster templates for all versions DOCKER_TEMPLATES := test/e2e/data/infrastructure-docker INMEMORY_TEMPLATES := test/e2e/data/infrastructure-inmemory -.PHONY: generate-e2e-templates-v0.4 -generate-e2e-templates-v0.4: $(KUSTOMIZE) - $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v0.4/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v0.4/cluster-template.yaml - .PHONY: generate-e2e-templates-v1.0 generate-e2e-templates-v1.0: $(KUSTOMIZE) $(KUSTOMIZE) build $(DOCKER_TEMPLATES)/v1.0/cluster-template --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/v1.0/cluster-template.yaml diff --git a/api/v1alpha4/cluster_types.go b/api/v1alpha4/cluster_types.go index 254b2874b1c0..ddf2ab50941c 100644 --- a/api/v1alpha4/cluster_types.go +++ b/api/v1alpha4/cluster_types.go @@ -276,6 +276,7 @@ func (v APIEndpoint) String() string { // ANCHOR_END: APIEndpoint // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=clusters,shortName=cl,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status diff --git a/api/v1alpha4/clusterclass_types.go b/api/v1alpha4/clusterclass_types.go index 62720d5650b3..ddb7276adf0e 100644 --- a/api/v1alpha4/clusterclass_types.go +++ b/api/v1alpha4/clusterclass_types.go @@ -22,6 +22,7 @@ import ( ) // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=clusterclasses,shortName=cc,scope=Namespaced,categories=cluster-api // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterClass" diff --git a/api/v1alpha4/machine_types.go b/api/v1alpha4/machine_types.go index 08f1abd7659d..6f5c7ba87d14 100644 --- a/api/v1alpha4/machine_types.go +++ b/api/v1alpha4/machine_types.go @@ -234,6 +234,7 @@ type Bootstrap struct { // ANCHOR_END: Bootstrap // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=machines,shortName=ma,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status diff --git a/api/v1alpha4/machinedeployment_types.go b/api/v1alpha4/machinedeployment_types.go index 4c5243a0b9e5..46e70f3f9f9c 100644 --- a/api/v1alpha4/machinedeployment_types.go +++ b/api/v1alpha4/machinedeployment_types.go @@ -270,6 +270,7 @@ func (md *MachineDeploymentStatus) GetTypedPhase() MachineDeploymentPhase { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=machinedeployments,shortName=md,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status diff --git a/api/v1alpha4/machinehealthcheck_types.go b/api/v1alpha4/machinehealthcheck_types.go index b3346f1556ab..338970f6b013 100644 --- a/api/v1alpha4/machinehealthcheck_types.go +++ b/api/v1alpha4/machinehealthcheck_types.go @@ -125,6 +125,7 @@ type MachineHealthCheckStatus struct { // ANCHOR_END: MachineHealthCheckStatus // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=machinehealthchecks,shortName=mhc;mhcs,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status diff --git a/api/v1alpha4/machineset_types.go b/api/v1alpha4/machineset_types.go index f53ec5e4184f..dbfdffdb538d 100644 --- a/api/v1alpha4/machineset_types.go +++ b/api/v1alpha4/machineset_types.go @@ -195,6 +195,7 @@ func (m *MachineSet) Validate() field.ErrorList { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=machinesets,shortName=ms,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status diff --git a/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go b/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go index adaf37a86d29..aee964078dae 100644 --- a/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go +++ b/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go @@ -124,6 +124,7 @@ type KubeadmConfigStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=kubeadmconfigs,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status diff --git a/bootstrap/kubeadm/api/v1alpha4/kubeadmconfigtemplate_types.go b/bootstrap/kubeadm/api/v1alpha4/kubeadmconfigtemplate_types.go index 34aada3d9917..5a2f362c90dc 100644 --- a/bootstrap/kubeadm/api/v1alpha4/kubeadmconfigtemplate_types.go +++ b/bootstrap/kubeadm/api/v1alpha4/kubeadmconfigtemplate_types.go @@ -31,6 +31,7 @@ type KubeadmConfigTemplateResource struct { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=kubeadmconfigtemplates,scope=Namespaced,categories=cluster-api // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of KubeadmConfigTemplate" diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml index a24d72abcd7f..eca803530a6b 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -1988,7 +1988,7 @@ spec: type: boolean type: object type: object - served: true + served: false storage: false subresources: status: {} diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml index e8b897862b9d..cb2bc08bb1f1 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -1974,7 +1974,7 @@ spec: - template type: object type: object - served: true + served: false storage: false subresources: {} - additionalPrinterColumns: diff --git a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml index fac9eba3acc0..f95e227ff204 100644 --- a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml +++ b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml @@ -187,7 +187,7 @@ spec: type: array type: object type: object - served: true + served: false storage: false subresources: status: {} diff --git a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml index f00315537a2c..3b3c6a4743a0 100644 --- a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml +++ b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml @@ -334,7 +334,7 @@ spec: type: integer type: object type: object - served: true + served: false storage: false subresources: status: {} diff --git a/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml b/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml index 0f37b39fe373..61a65342190f 100644 --- a/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml +++ b/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml @@ -381,7 +381,7 @@ spec: type: object type: object type: object - served: true + served: false storage: false subresources: {} - additionalPrinterColumns: diff --git a/config/crd/bases/cluster.x-k8s.io_clusters.yaml b/config/crd/bases/cluster.x-k8s.io_clusters.yaml index a625583fa5c2..ce70440031a7 100644 --- a/config/crd/bases/cluster.x-k8s.io_clusters.yaml +++ b/config/crd/bases/cluster.x-k8s.io_clusters.yaml @@ -660,7 +660,7 @@ spec: type: string type: object type: object - served: true + served: false storage: false subresources: status: {} diff --git a/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml b/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml index 20282f3f380e..73ff5bdd2d0f 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml @@ -966,7 +966,7 @@ spec: type: integer type: object type: object - served: true + served: false storage: false subresources: scale: diff --git a/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml b/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml index 69f9d0cb76c7..2ed3698190c6 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml @@ -540,7 +540,7 @@ spec: type: array type: object type: object - served: true + served: false storage: false subresources: status: {} diff --git a/config/crd/bases/cluster.x-k8s.io_machinepools.yaml b/config/crd/bases/cluster.x-k8s.io_machinepools.yaml index 583c78507fa7..9fcd47760f3f 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinepools.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinepools.yaml @@ -968,7 +968,7 @@ spec: type: integer type: object type: object - served: true + served: false storage: false subresources: scale: diff --git a/config/crd/bases/cluster.x-k8s.io_machines.yaml b/config/crd/bases/cluster.x-k8s.io_machines.yaml index 9553a78fc2ca..335c4856e764 100644 --- a/config/crd/bases/cluster.x-k8s.io_machines.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machines.yaml @@ -750,7 +750,7 @@ spec: type: string type: object type: object - served: true + served: false storage: false subresources: status: {} diff --git a/config/crd/bases/cluster.x-k8s.io_machinesets.yaml b/config/crd/bases/cluster.x-k8s.io_machinesets.yaml index 051e93477f87..fac384ca5201 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinesets.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinesets.yaml @@ -846,7 +846,7 @@ spec: type: string type: object type: object - served: true + served: false storage: false subresources: scale: diff --git a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go b/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go index 19664a4e759d..00ea8484e382 100644 --- a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go +++ b/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go @@ -198,6 +198,7 @@ type KubeadmControlPlaneStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=kubeadmcontrolplanes,shortName=kcp,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status diff --git a/controlplane/kubeadm/api/v1alpha4/kubeadmcontrolplanetemplate_types.go b/controlplane/kubeadm/api/v1alpha4/kubeadmcontrolplanetemplate_types.go index 233a7e7cc316..b76e01e5304f 100644 --- a/controlplane/kubeadm/api/v1alpha4/kubeadmcontrolplanetemplate_types.go +++ b/controlplane/kubeadm/api/v1alpha4/kubeadmcontrolplanetemplate_types.go @@ -26,6 +26,7 @@ type KubeadmControlPlaneTemplateSpec struct { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=kubeadmcontrolplanetemplates,scope=Namespaced,categories=cluster-api // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of KubeadmControlPlaneTemplate" diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml index f9ac22eb3dd9..98ed4c373324 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -2396,7 +2396,7 @@ spec: type: string type: object type: object - served: true + served: false storage: false subresources: scale: diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml index 1a6d560e94c6..19f4dd69bb23 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -1173,7 +1173,7 @@ spec: - template type: object type: object - served: true + served: false storage: false subresources: {} - additionalPrinterColumns: diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md index 6ad07239c7c1..eb7304e6a5e1 100644 --- a/docs/book/src/SUMMARY.md +++ b/docs/book/src/SUMMARY.md @@ -90,6 +90,7 @@ - [v1.2 to v1.3](./developer/providers/migrations/v1.2-to-v1.3.md) - [v1.3 to v1.4](./developer/providers/migrations/v1.3-to-v1.4.md) - [v1.4 to v1.5](./developer/providers/migrations/v1.4-to-v1.5.md) + - [v1.5 to v1.6](./developer/providers/migrations/v1.5-to-v1.6.md) - [Provider contracts](./developer/providers/contracts.md) - [Cluster Infrastructure](./developer/providers/cluster-infrastructure.md) - [Machine Infrastructure](./developer/providers/machine-infrastructure.md) diff --git a/docs/book/src/clusterctl/commands/upgrade.md b/docs/book/src/clusterctl/commands/upgrade.md index dac3f6d058f6..88c8bb92c7ee 100644 --- a/docs/book/src/clusterctl/commands/upgrade.md +++ b/docs/book/src/clusterctl/commands/upgrade.md @@ -83,11 +83,10 @@ Cluster API only tests a subset of possible clusterctl upgrade paths as otherwis Untested upgrade paths are not blocked by clusterctl and should work in general, they are just not tested. Users intending to use an upgrade path not tested by us should do their own validation to ensure the operation works correctly. -The following is an example of the tested upgrade paths while v1.5 is being developed: +The following is an example of the tested upgrade paths while v1.6 is being developed: | From | To | Note | |------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| v0.4 | latest | v0.4 is the latest supported minor release with the v1alpha4 contract (v0.4 is EOL since 2022-04-06). This test will be removed once the v1alpha4 apiVersion is removed. | | v1.0 | latest | v1.0 is the first release with the v1beta1 contract. | | v1.3 | latest | v1.3 is a currently supported release. This test will be removed when v1.5 is released and a new test for v1.5 is added. | | v1.4 | latest | v1.4 is a currently supported release. This test will be removed when v1.6 is released and a new test for v1.6 is added. | diff --git a/docs/book/src/developer/providers/migrations/v1.5-to-v1.6.md b/docs/book/src/developer/providers/migrations/v1.5-to-v1.6.md new file mode 100644 index 000000000000..983b303d9dad --- /dev/null +++ b/docs/book/src/developer/providers/migrations/v1.5-to-v1.6.md @@ -0,0 +1,33 @@ +# Cluster API v1.5 compared to v1.6 + +This document provides an overview over relevant changes between Cluster API v1.5 and v1.6 for +maintainers of providers and consumers of our Go API. + +## Go version + +- The Go version used by Cluster API is Go 1.20.x + +## Dependencies + +**Note**: Only the most relevant dependencies are listed, `k8s.io/` and `ginkgo`/`gomega` dependencies in Cluster API are kept in sync with the versions used by `sigs.k8s.io/controller-runtime`. + +- sigs.k8s.io/kind: v0.20.x +- sigs.k8s.io/controller-runtime: v0.15.x +- sigs.k8s.io/controller-tools: v0.12.x + +## Changes by Kind + +### Deprecation + +### Removals + +- API version `v1alpha4` is not served in v1.6 (users can enable it manually in case they are lagging behind with deprecation cycles). Important: `v1alpha4` will be completely removed in 1.7. + +### API Changes + + +### Other + + +### Suggested changes for providers + diff --git a/docs/release/release-tasks.md b/docs/release/release-tasks.md index db787055f983..96a7ade348d1 100644 --- a/docs/release/release-tasks.md +++ b/docs/release/release-tasks.md @@ -22,6 +22,7 @@ This document details the responsibilities and tasks for each role in the releas - [Prepare main branch for development of the new release](#prepare-main-branch-for-development-of-the-new-release) - [Create a new GitHub milestone for the next release](#create-a-new-github-milestone-for-the-next-release) - [\[Track\] Remove previously deprecated code](#track-remove-previously-deprecated-code) + - - [\[Track\] Bump dependencies](#track-bump-dependencies) - [Create a release branch](#create-a-release-branch) - [\[Continuously\] Maintain the GitHub release milestone](#continuously-maintain-the-github-release-milestone) @@ -94,7 +95,6 @@ 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.3` to `v1.4`: 1. Setup E2E tests for the new release: 1. Goal is that we have clusterctl upgrade tests for the latest stable versions of each contract / for each supported branch. For `v1.5` this means: - * v1alpha4: `v0.4` * v1beta1: `v1.0`, `v1.3`, `v1.4` (will change with each new release) 2. Update providers in `docker.yaml`: 1. Add a new `v1.4.0` entry. diff --git a/exp/addons/api/v1alpha4/clusterresourceset_types.go b/exp/addons/api/v1alpha4/clusterresourceset_types.go index 863adc966730..2438e03a50ba 100644 --- a/exp/addons/api/v1alpha4/clusterresourceset_types.go +++ b/exp/addons/api/v1alpha4/clusterresourceset_types.go @@ -112,6 +112,7 @@ func (m *ClusterResourceSet) SetConditions(conditions clusterv1alpha4.Conditions } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=clusterresourcesets,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status diff --git a/exp/addons/api/v1alpha4/clusterresourcesetbinding_types.go b/exp/addons/api/v1alpha4/clusterresourcesetbinding_types.go index 44778e9db9c5..acf64a54f2b5 100644 --- a/exp/addons/api/v1alpha4/clusterresourcesetbinding_types.go +++ b/exp/addons/api/v1alpha4/clusterresourcesetbinding_types.go @@ -101,6 +101,7 @@ func (c *ClusterResourceSetBinding) DeleteBinding(clusterResourceSet *ClusterRes } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=clusterresourcesetbindings,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status diff --git a/exp/api/v1alpha4/machinepool_types.go b/exp/api/v1alpha4/machinepool_types.go index 6b8c5042be0d..09de899a78a1 100644 --- a/exp/api/v1alpha4/machinepool_types.go +++ b/exp/api/v1alpha4/machinepool_types.go @@ -199,6 +199,7 @@ func (m *MachinePoolStatus) GetTypedPhase() MachinePoolPhase { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=machinepools,shortName=mp,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status diff --git a/test/e2e/clusterctl_upgrade_test.go b/test/e2e/clusterctl_upgrade_test.go index 8df575442d6d..2a1b7bdeaf02 100644 --- a/test/e2e/clusterctl_upgrade_test.go +++ b/test/e2e/clusterctl_upgrade_test.go @@ -26,37 +26,6 @@ import ( "sigs.k8s.io/cluster-api/test/framework" ) -var _ = Describe("When testing clusterctl upgrades (v0.4=>current)", func() { - ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput { - return ClusterctlUpgradeSpecInput{ - E2EConfig: e2eConfig, - ClusterctlConfigPath: clusterctlConfigPath, - BootstrapClusterProxy: bootstrapClusterProxy, - ArtifactFolder: artifactFolder, - SkipCleanup: skipCleanup, - InfrastructureProvider: pointer.String("docker"), - InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.8/clusterctl-{OS}-{ARCH}", - InitWithProvidersContract: "v1alpha4", - // NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v0.4/bases. - InitWithKubernetesVersion: "v1.23.17", - WorkloadKubernetesVersion: "v1.23.17", - MgmtFlavor: "topology", - WorkloadFlavor: "", - // This check ensures that ownerReference apiVersions are updated for all types after the upgrade. - PostUpgrade: func(proxy framework.ClusterProxy, namespace, clusterName string) { - framework.ValidateOwnerReferencesOnUpdate(proxy, namespace, - framework.CoreOwnerReferenceAssertion, - framework.ExpOwnerReferenceAssertions, - framework.DockerInfraOwnerReferenceAssertions, - framework.KubeadmBootstrapOwnerReferenceAssertions, - framework.KubeadmControlPlaneOwnerReferenceAssertions, - framework.KubernetesReferenceAssertions, - ) - }, - } - }) -}) - var _ = Describe("When testing clusterctl upgrades (v1.0=>current)", func() { ClusterctlUpgradeSpec(ctx, func() ClusterctlUpgradeSpecInput { return ClusterctlUpgradeSpecInput{ diff --git a/test/e2e/config/docker.yaml b/test/e2e/config/docker.yaml index c18c07a5ca88..dc11eb281596 100644 --- a/test/e2e/config/docker.yaml +++ b/test/e2e/config/docker.yaml @@ -35,15 +35,6 @@ providers: - name: cluster-api type: CoreProvider versions: - - name: v0.4.8 # latest published release in the v1alpha4 series; this is used for v1alpha4 --> v1beta1 clusterctl upgrades test only. - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.8/core-components.yaml" - type: "url" - contract: v1alpha4 - replacements: - - old: --metrics-addr=127.0.0.1:8080 - new: --metrics-addr=:8080 - files: - - sourcePath: "../data/shared/v0.4/metadata.yaml" - name: v1.0.5 # supported release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.5/core-components.yaml" type: "url" @@ -82,15 +73,6 @@ providers: - name: kubeadm type: BootstrapProvider versions: - - name: v0.4.8 # latest published release in the v1alpha4 series; this is used for v1alpha4 --> v1beta1 clusterctl upgrades test only. - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.8/bootstrap-components.yaml" - type: "url" - contract: v1alpha4 - replacements: - - old: --metrics-addr=127.0.0.1:8080 - new: --metrics-addr=:8080 - files: - - sourcePath: "../data/shared/v0.4/metadata.yaml" - name: v1.0.5 # supported release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.5/bootstrap-components.yaml" type: "url" @@ -129,15 +111,6 @@ providers: - name: kubeadm type: ControlPlaneProvider versions: - - name: v0.4.8 # latest published release in the v1alpha4 series; this is used for v1alpha4 --> v1beta1 clusterctl upgrades test only. - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.8/control-plane-components.yaml" - type: "url" - contract: v1alpha4 - replacements: - - old: --metrics-addr=127.0.0.1:8080 - new: --metrics-addr=:8080 - files: - - sourcePath: "../data/shared/v0.4/metadata.yaml" - name: v1.0.5 # supported release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.5/control-plane-components.yaml" type: "url" @@ -176,16 +149,6 @@ providers: - name: docker type: InfrastructureProvider versions: - - name: v0.4.8 # latest published release in the v1alpha4 series; this is used for v1alpha4 --> v1beta1 clusterctl upgrades test only. - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.8/infrastructure-components-development.yaml" - type: "url" - contract: v1alpha4 - replacements: - - old: --metrics-addr=127.0.0.1:8080 - new: --metrics-addr=:8080 - files: - - sourcePath: "../data/shared/v0.4/metadata.yaml" - - sourcePath: "../data/infrastructure-docker/v0.4/cluster-template.yaml" - name: v1.0.5 # supported release in the v1beta1 series; this is used for v1beta1 --> main clusterctl upgrades test only. value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.5/infrastructure-components-development.yaml" type: "url" diff --git a/test/e2e/data/infrastructure-docker/README.md b/test/e2e/data/infrastructure-docker/README.md index 1ae99f0ee5e2..ae8a6a07062d 100644 --- a/test/e2e/data/infrastructure-docker/README.md +++ b/test/e2e/data/infrastructure-docker/README.md @@ -7,8 +7,8 @@ Sub-folders for the old versions of Cluster API should contain only templates us In those tests we first deploy an old version of Cluster API, create a workload cluster and then upgrade Cluster API to the version from the current branch (and check that the workload cluster still works). -As of today we have clusterctl upgrade tests for the latest stable versions of each supported branch and an additional -test for v1alpha4 / v0.4 which will be removed when that version is no longer served. +As of today we have clusterctl upgrade tests for the latest stable versions of each supported branch and an additional +version for upgrading 1.0 - the first version release with the v1beta1 API Version. We cannot use the same cluster templates for all Cluster API versions as not each Cluster API version supports the same API fields. For example `KubeadmControlPlane.spec.rolloutBefore.certificatesExpiryDays` was introduced diff --git a/test/e2e/data/infrastructure-docker/v0.4/bases/cluster-with-kcp.yaml b/test/e2e/data/infrastructure-docker/v0.4/bases/cluster-with-kcp.yaml deleted file mode 100644 index 371789cf5745..000000000000 --- a/test/e2e/data/infrastructure-docker/v0.4/bases/cluster-with-kcp.yaml +++ /dev/null @@ -1,87 +0,0 @@ ---- -# DockerCluster object referenced by the Cluster object -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: DockerCluster -metadata: - name: '${CLUSTER_NAME}' ---- -# Cluster object with -# - Reference to the KubeadmControlPlane object -# - the label cni=${CLUSTER_NAME}-crs-0, so the cluster can be selected by the ClusterResourceSet. -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - name: '${CLUSTER_NAME}' - labels: - cni: "${CLUSTER_NAME}-crs-0" -spec: - clusterNetwork: - services: - cidrBlocks: ['${DOCKER_SERVICE_CIDRS}'] - pods: - cidrBlocks: ['${DOCKER_POD_CIDRS}'] - serviceDomain: '${DOCKER_SERVICE_DOMAIN}' - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: DockerCluster - name: '${CLUSTER_NAME}' - controlPlaneRef: - kind: KubeadmControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - name: "${CLUSTER_NAME}-control-plane" ---- -# DockerMachineTemplate object referenced by the KubeadmControlPlane object -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: DockerMachineTemplate -metadata: - name: "${CLUSTER_NAME}-control-plane" -spec: - template: - spec: - # NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here. - customImage: "kindest/node:v1.23.17@sha256:f77f8cf0b30430ca4128cc7cfafece0c274a118cd0cdb251049664ace0dee4ff" - extraMounts: - - containerPath: "/var/run/docker.sock" - hostPath: "/var/run/docker.sock" ---- -# KubeadmControlPlane referenced by the Cluster object with -# - the label kcp-adoption.step2, because it should be created in the second step of the kcp-adoption test. -kind: KubeadmControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -metadata: - name: "${CLUSTER_NAME}-control-plane" - labels: - kcp-adoption.step2: "" -spec: - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - machineTemplate: - infrastructureRef: - kind: DockerMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - name: "${CLUSTER_NAME}-control-plane" - kubeadmConfigSpec: - clusterConfiguration: - controllerManager: - extraArgs: {enable-hostpath-provisioner: 'true'} - apiServer: - # host.docker.internal is required by kubetest when running on MacOS because of the way ports are proxied. - certSANs: [localhost, 127.0.0.1, 0.0.0.0, host.docker.internal] - initConfiguration: - nodeRegistration: - criSocket: unix:///var/run/containerd/containerd.sock - kubeletExtraArgs: - # We have to pin the cgroupDriver to cgroupfs for Kubernetes < v1.24 because kind does not support systemd for those versions, but kubeadm >= 1.21 defaults to systemd. - # This cluster is used in tests where the Kubernetes version is < 1.24 - cgroup-driver: cgroupfs - eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' - fail-swap-on: "false" - joinConfiguration: - nodeRegistration: - criSocket: unix:///var/run/containerd/containerd.sock - kubeletExtraArgs: - # We have to pin the cgroupDriver to cgroupfs for Kubernetes < v1.24 because kind does not support systemd for those versions, but kubeadm >= 1.21 defaults to systemd. - # This cluster is used in tests where the Kubernetes version is < 1.24 - cgroup-driver: cgroupfs - eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' - fail-swap-on: "false" - version: "${KUBERNETES_VERSION}" diff --git a/test/e2e/data/infrastructure-docker/v0.4/bases/crs.yaml b/test/e2e/data/infrastructure-docker/v0.4/bases/crs.yaml deleted file mode 100644 index 7f8f9f9d46e1..000000000000 --- a/test/e2e/data/infrastructure-docker/v0.4/bases/crs.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -# ConfigMap object referenced by the ClusterResourceSet object and with -# the CNI resource defined in the test config file -apiVersion: v1 -kind: ConfigMap -metadata: - name: "cni-${CLUSTER_NAME}-crs-0" -data: ${CNI_RESOURCES} -binaryData: ---- -# ClusterResourceSet object with -# a selector that targets all the Cluster with label cni=${CLUSTER_NAME}-crs-0 -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: "${CLUSTER_NAME}-crs-0" -spec: - strategy: ApplyOnce - clusterSelector: - matchLabels: - cni: "${CLUSTER_NAME}-crs-0" - resources: - - name: "cni-${CLUSTER_NAME}-crs-0" - kind: ConfigMap diff --git a/test/e2e/data/infrastructure-docker/v0.4/bases/md.yaml b/test/e2e/data/infrastructure-docker/v0.4/bases/md.yaml deleted file mode 100644 index e7c19d3c4497..000000000000 --- a/test/e2e/data/infrastructure-docker/v0.4/bases/md.yaml +++ /dev/null @@ -1,57 +0,0 @@ ---- -# DockerMachineTemplate referenced by the MachineDeployment and with -# - extraMounts for the docker sock, thus allowing self-hosting test -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: DockerMachineTemplate -metadata: - name: "${CLUSTER_NAME}-md-0" -spec: - template: - spec: - # NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here. - customImage: "kindest/node:v1.23.17@sha256:f77f8cf0b30430ca4128cc7cfafece0c274a118cd0cdb251049664ace0dee4ff" - extraMounts: - - containerPath: "/var/run/docker.sock" - hostPath: "/var/run/docker.sock" ---- -# KubeadmConfigTemplate referenced by the MachineDeployment -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: "${CLUSTER_NAME}-md-0" -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - criSocket: unix:///var/run/containerd/containerd.sock - kubeletExtraArgs: - # We have to pin the cgroupDriver to cgroupfs for Kubernetes < v1.24 because kind does not support systemd for those versions, but kubeadm >= 1.21 defaults to systemd. - # This cluster is used in tests where the Kubernetes version is < 1.24 - cgroup-driver: cgroupfs - eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' - fail-swap-on: "false" ---- -# MachineDeployment object -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineDeployment -metadata: - name: "${CLUSTER_NAME}-md-0" -spec: - clusterName: "${CLUSTER_NAME}" - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: - template: - spec: - clusterName: "${CLUSTER_NAME}" - version: "${KUBERNETES_VERSION}" - bootstrap: - configRef: - name: "${CLUSTER_NAME}-md-0" - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfigTemplate - infrastructureRef: - name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: DockerMachineTemplate diff --git a/test/e2e/data/infrastructure-docker/v0.4/cluster-template/kustomization.yaml b/test/e2e/data/infrastructure-docker/v0.4/cluster-template/kustomization.yaml deleted file mode 100644 index c7805717ecc1..000000000000 --- a/test/e2e/data/infrastructure-docker/v0.4/cluster-template/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -bases: -- ../bases/cluster-with-kcp.yaml -- ../bases/md.yaml -- ../bases/crs.yaml \ No newline at end of file diff --git a/test/e2e/data/shared/v0.4/metadata.yaml b/test/e2e/data/shared/v0.4/metadata.yaml deleted file mode 100644 index 318ea96c6eda..000000000000 --- a/test/e2e/data/shared/v0.4/metadata.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3 -kind: Metadata -releaseSeries: - - major: 0 - minor: 4 - contract: v1alpha4 - - major: 0 - minor: 3 - contract: v1alpha3 - - major: 0 - minor: 2 - contract: v1alpha2 \ No newline at end of file diff --git a/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go b/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go index 3073d0f96684..a0353cd732df 100644 --- a/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go +++ b/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go @@ -95,6 +95,7 @@ type APIEndpoint struct { // +kubebuilder:resource:path=dockerclusters,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerCluster" diff --git a/test/infrastructure/docker/api/v1alpha4/dockerclustertemplate_types.go b/test/infrastructure/docker/api/v1alpha4/dockerclustertemplate_types.go index b29959f49c63..88b3a56a8552 100644 --- a/test/infrastructure/docker/api/v1alpha4/dockerclustertemplate_types.go +++ b/test/infrastructure/docker/api/v1alpha4/dockerclustertemplate_types.go @@ -26,6 +26,7 @@ type DockerClusterTemplateSpec struct { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerClusterTemplate" diff --git a/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go b/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go index a96279d69855..411a244c53f7 100644 --- a/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go +++ b/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go @@ -93,6 +93,7 @@ type DockerMachineStatus struct { // +kubebuilder:resource:path=dockermachines,scope=Namespaced,categories=cluster-api // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerMachine" diff --git a/test/infrastructure/docker/api/v1alpha4/dockermachinetemplate_types.go b/test/infrastructure/docker/api/v1alpha4/dockermachinetemplate_types.go index 36b225fe8ecf..a4e234458bbc 100644 --- a/test/infrastructure/docker/api/v1alpha4/dockermachinetemplate_types.go +++ b/test/infrastructure/docker/api/v1alpha4/dockermachinetemplate_types.go @@ -26,6 +26,7 @@ type DockerMachineTemplateSpec struct { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:resource:path=dockermachinetemplates,scope=Namespaced,categories=cluster-api // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerMachineTemplate" diff --git a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclusters.yaml b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclusters.yaml index a2b88acf0c29..fb3c078287cb 100644 --- a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclusters.yaml +++ b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclusters.yaml @@ -310,7 +310,7 @@ spec: - ready type: object type: object - served: true + served: false storage: false subresources: status: {} diff --git a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclustertemplates.yaml b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclustertemplates.yaml index 43bdd93fc62b..2e87c6507c10 100644 --- a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclustertemplates.yaml +++ b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclustertemplates.yaml @@ -114,7 +114,7 @@ spec: - template type: object type: object - served: true + served: false storage: false subresources: {} - additionalPrinterColumns: diff --git a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinepools.yaml b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinepools.yaml index c8b0e92675c3..b322b17ebdcb 100644 --- a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinepools.yaml +++ b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinepools.yaml @@ -379,7 +379,7 @@ spec: type: integer type: object type: object - served: true + served: false storage: false subresources: status: {} diff --git a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachines.yaml b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachines.yaml index 5dc540fed23a..2922fa57b91f 100644 --- a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachines.yaml +++ b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachines.yaml @@ -303,7 +303,7 @@ spec: type: boolean type: object type: object - served: true + served: false storage: false subresources: status: {} diff --git a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinetemplates.yaml b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinetemplates.yaml index bf9afa14a380..9e7eefac31a4 100644 --- a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinetemplates.yaml +++ b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinetemplates.yaml @@ -183,7 +183,7 @@ spec: - template type: object type: object - served: true + served: false storage: false subresources: {} - additionalPrinterColumns: diff --git a/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go b/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go index 33fc201ac40d..ff0590c297a1 100644 --- a/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go +++ b/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go @@ -113,6 +113,7 @@ type DockerMachinePoolInstanceStatus struct { // +kubebuilder:resource:path=dockermachinepools,scope=Namespaced,categories=cluster-api // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerMachinePool"