@@ -129,7 +129,7 @@ type ClusterctlUpgradeSpecInput struct {
129
129
WorkloadKubernetesVersion string
130
130
131
131
// Upgrades allows to define upgrade sequences.
132
- // If not set, the test will upgrade once to the v1beta1 contract.
132
+ // If not set, the test will upgrade once to the latest contract.
133
133
// For some examples see clusterctl_upgrade_test.go
134
134
Upgrades []ClusterctlUpgradeSpecInputUpgrade
135
135
@@ -161,7 +161,7 @@ type ClusterctlUpgradeSpecInputUpgrade struct {
161
161
162
162
// ClusterctlUpgradeSpec implements a test that verifies clusterctl upgrade of a management cluster.
163
163
//
164
- // NOTE: this test is designed to test older versions of Cluster API --> v1beta1 upgrades.
164
+ // NOTE: this test is designed to test older versions of Cluster API --> latest contract version upgrades.
165
165
// This spec will create a workload cluster, which will be converted into a new management cluster (henceforth called secondary
166
166
// managemnet cluster)
167
167
// with the older version of Cluster API and infrastructure provider. It will then create an additional
@@ -231,7 +231,7 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
231
231
initClusterctlBinaryURL = clusterctlBinaryURLReplacer .Replace (clusterctlBinaryURLTemplate )
232
232
233
233
// NOTE: by default we are considering all the providers, no matter of the contract.
234
- // However, given that we want to test both v1alpha3 --> v1beta1 and v1alpha4 --> v1beta1,
234
+ // However, given that we want to test both v1alpha3 --> v1beta1, v1alpha4 --> v1beta1, v1beta1 --> v1beta2 ,
235
235
// InitWithProvidersContract can be used to select versions with a specific contract.
236
236
initContract = "*"
237
237
if input .InitWithProvidersContract != "" {
@@ -241,7 +241,7 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
241
241
initKubernetesVersion = input .InitWithKubernetesVersion
242
242
243
243
if len (input .Upgrades ) == 0 {
244
- // Upgrade once to v1beta1 if no upgrades are specified.
244
+ // Upgrade once to latest contract version if no upgrades are specified.
245
245
input .Upgrades = []ClusterctlUpgradeSpecInputUpgrade {
246
246
{
247
247
Contract : clusterv1 .GroupVersion .Version ,
@@ -467,7 +467,7 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
467
467
468
468
coreCAPIStorageVersion := getCoreCAPIStorageVersion (ctx , managementClusterProxy .GetClient ())
469
469
470
- // Note: We have to use unstructured here as the Cluster could be e.g. v1alpha3 / v1alpha4 / v1beta1 .
470
+ // Note: We have to use unstructured here as the Cluster could use also old API versions .
471
471
workloadClusterUnstructured := discoveryAndWaitForCluster (ctx , discoveryAndWaitForClusterInput {
472
472
Client : managementClusterProxy .GetClient (),
473
473
CoreCAPIStorageVersion : coreCAPIStorageVersion ,
@@ -609,7 +609,7 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
609
609
// We have to get the core CAPI storage version again as the upgrade might have stopped serving v1alpha3/v1alpha4.
610
610
coreCAPIStorageVersion = getCoreCAPIStorageVersion (ctx , managementClusterProxy .GetClient ())
611
611
612
- // Note: Currently we only support v1beta1 core CAPI apiVersion after upgrades.
612
+ // Note: Currently we only support v1beta2 core CAPI apiVersion after upgrades.
613
613
// This seems a reasonable simplification as we don't want to test upgrades to v1alpha3 / v1alpha4.
614
614
workloadCluster := framework .DiscoveryAndWaitForCluster (ctx , framework.DiscoveryAndWaitForClusterInput {
615
615
Getter : managementClusterProxy .GetClient (),
@@ -891,8 +891,7 @@ func discoveryAndWaitForCluster(ctx context.Context, input discoveryAndWaitForCl
891
891
func calculateExpectedMachineDeploymentMachineCount (ctx context.Context , c client.Client , unstructuredCluster * unstructured.Unstructured , coreCAPIStorageVersion string ) int64 {
892
892
var expectedMachineDeploymentWorkerCount int64
893
893
894
- // Convert v1beta1 unstructured Cluster to clusterv1.Cluster
895
- // Only v1beta1 Cluster support ClusterClass (i.e. have cluster.spec.topology).
894
+ // Convert unstructured Cluster to Cluster.
896
895
if unstructuredCluster .GroupVersionKind ().Version == clusterv1 .GroupVersion .Version {
897
896
cluster := & clusterv1.Cluster {}
898
897
Expect (apiruntime .DefaultUnstructuredConverter .FromUnstructured (unstructuredCluster .Object , cluster )).To (Succeed ())
@@ -968,8 +967,7 @@ func calculateExpectedMachinePoolMachineCount(ctx context.Context, c client.Clie
968
967
func calculateExpectedMachinePoolNodeCount (ctx context.Context , c client.Client , unstructuredCluster * unstructured.Unstructured , coreCAPIStorageVersion string ) int64 {
969
968
var expectedMachinePoolWorkerCount int64
970
969
971
- // Convert v1beta1 unstructured Cluster to clusterv1.Cluster
972
- // Only v1beta1 Cluster support ClusterClass (i.e. have cluster.spec.topology).
970
+ // Convert unstructured Cluster to Cluster
973
971
if unstructuredCluster .GroupVersionKind ().Version == clusterv1 .GroupVersion .Version {
974
972
cluster := & clusterv1.Cluster {}
975
973
Expect (apiruntime .DefaultUnstructuredConverter .FromUnstructured (unstructuredCluster .Object , cluster )).To (Succeed ())
0 commit comments