Skip to content

Commit e7ca5f4

Browse files
committed
apply v1beta2 validation to e2e tests
Signed-off-by: sivchari <[email protected]>
1 parent 39ec951 commit e7ca5f4

17 files changed

+108
-2
lines changed

test/e2e/autoscaler.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ func AutoscalerSpec(ctx context.Context, inputGetter func() AutoscalerSpecInput)
367367
})
368368
}
369369

370+
Byf("Verify v1beta2 Available and Ready conditions (if exist) to be true for Cluster and Machines")
371+
verifyV1Beta2Conditions(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster.Name, clusterResources.Cluster.Namespace,
372+
map[string]struct{}{
373+
clusterv1.AvailableCondition: {}, clusterv1.ReadyCondition: {},
374+
})
375+
370376
By("PASSED!")
371377
})
372378

test/e2e/cluster_deletion.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@ func ClusterDeletionSpec(ctx context.Context, inputGetter func() ClusterDeletion
198198
},
199199
}, clusterResources)
200200

201+
Byf("Verify v1beta2 Available and Ready conditions (if exist) to be true for Cluster and Machines")
202+
verifyV1Beta2Conditions(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster.Name, clusterResources.Cluster.Namespace,
203+
map[string]struct{}{
204+
clusterv1.AvailableCondition: {}, clusterv1.ReadyCondition: {},
205+
})
206+
201207
// Get all objects per deletion phase and the list of blocking objects.
202208
var objectsPerPhase [][]client.Object
203209
objectsPerPhase, blockingObjects = getDeletionPhaseObjects(ctx, input.BootstrapClusterProxy, clusterResources.Cluster, input.ClusterDeletionPhases)

test/e2e/cluster_upgrade.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
corev1 "k8s.io/api/core/v1"
2828
"k8s.io/utils/ptr"
2929

30+
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta2"
3031
"sigs.k8s.io/cluster-api/test/framework"
3132
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
3233
"sigs.k8s.io/cluster-api/test/framework/kubetest"
@@ -259,6 +260,12 @@ func ClusterUpgradeConformanceSpec(ctx context.Context, inputGetter func() Clust
259260
WaitForNodesReady: input.E2EConfig.GetIntervals(specName, "wait-nodes-ready"),
260261
})
261262

263+
Byf("Verify v1beta2 Available and Ready conditions (if exist) to be true for Cluster and Machines")
264+
verifyV1Beta2Conditions(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster.Name, clusterResources.Cluster.Namespace,
265+
map[string]struct{}{
266+
clusterv1.AvailableCondition: {}, clusterv1.ReadyCondition: {},
267+
})
268+
262269
if !input.SkipConformanceTests {
263270
By("Running conformance tests")
264271
// Start running the conformance test suite.

test/e2e/cluster_upgrade_runtimesdk.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,12 @@ func ClusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() Cl
347347
"AfterClusterUpgrade": "Success",
348348
})).To(Succeed(), "Lifecycle hook calls were not as expected")
349349

350+
Byf("Verify v1beta2 Available and Ready conditions (if exist) to be true for Cluster and Machines")
351+
verifyV1Beta2Conditions(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster.Name, clusterResources.Cluster.Namespace,
352+
map[string]struct{}{
353+
clusterv1.AvailableCondition: {}, clusterv1.ReadyCondition: {},
354+
})
355+
350356
By("PASSED!")
351357
})
352358

test/e2e/clusterclass_changes.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,12 @@ func ClusterClassChangesSpec(ctx context.Context, inputGetter func() ClusterClas
272272
WaitForMachinePools: input.E2EConfig.GetIntervals(specName, "wait-machine-pool-nodes"),
273273
})
274274

275+
Byf("Verify v1beta2 Available and Ready conditions (if exist) to be true for Cluster and Machines")
276+
verifyV1Beta2Conditions(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster.Name, clusterResources.Cluster.Namespace,
277+
map[string]struct{}{
278+
clusterv1.AvailableCondition: {}, clusterv1.ReadyCondition: {},
279+
})
280+
275281
By("Deleting a MachineDeploymentTopology in the Cluster Topology and wait for associated MachineDeployment to be deleted")
276282
deleteMachineDeploymentTopologyAndWait(ctx, deleteMachineDeploymentTopologyAndWaitInput{
277283
ClusterProxy: input.BootstrapClusterProxy,

test/e2e/clusterclass_rollout.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,12 @@ func ClusterClassRolloutSpec(ctx context.Context, inputGetter func() ClusterClas
302302
}, input.E2EConfig.GetIntervals(specName, "wait-machine-upgrade")...).Should(Succeed())
303303
assertClusterObjects(ctx, input.BootstrapClusterProxy, clusterResources.Cluster, clusterResources.ClusterClass, input.FilterMetadataBeforeValidation)
304304

305+
Byf("Verify v1beta2 Available and Ready conditions (if exist) to be true for Cluster and Machines")
306+
verifyV1Beta2Conditions(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster.Name, clusterResources.Cluster.Namespace,
307+
map[string]struct{}{
308+
clusterv1.AvailableCondition: {}, clusterv1.ReadyCondition: {},
309+
})
310+
305311
By("PASSED!")
306312
})
307313

test/e2e/clusterctl_upgrade.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,10 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
723723
}
724724

725725
Byf("[%d] Verify v1beta2 Available and Ready conditions (if exist) to be true for Cluster and Machines", i)
726-
verifyV1Beta2ConditionsTrueV1Beta1(ctx, managementClusterProxy.GetClient(), workloadCluster.Name, workloadCluster.Namespace,
727-
[]string{clusterv1.AvailableCondition, clusterv1.ReadyCondition})
726+
verifyV1Beta2Conditions(ctx, managementClusterProxy.GetClient(), workloadCluster.Name, workloadCluster.Namespace,
727+
map[string]struct{}{
728+
clusterv1.AvailableCondition: {}, clusterv1.ReadyCondition: {},
729+
})
728730

729731
// Note: It is a known issue on Kubernetes < v1.29 that SSA sometimes fail:
730732
// https://github.com/kubernetes/kubernetes/issues/117356

test/e2e/k8s_conformance.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
corev1 "k8s.io/api/core/v1"
2929
"k8s.io/utils/ptr"
3030

31+
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta2"
3132
"sigs.k8s.io/cluster-api/test/framework"
3233
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
3334
"sigs.k8s.io/cluster-api/test/framework/kubetest"
@@ -153,6 +154,12 @@ func K8SConformanceSpec(ctx context.Context, inputGetter func() K8SConformanceSp
153154
)
154155
Expect(err).ToNot(HaveOccurred(), "Failed to run Kubernetes conformance")
155156

157+
Byf("Verify v1beta2 Available and Ready conditions (if exist) to be true for Cluster and Machines")
158+
verifyV1Beta2Conditions(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster.Name, clusterResources.Cluster.Namespace,
159+
map[string]struct{}{
160+
clusterv1.AvailableCondition: {}, clusterv1.ReadyCondition: {},
161+
})
162+
156163
By("PASSED!")
157164
})
158165

test/e2e/kcp_adoption.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,12 @@ func KCPAdoptionSpec(ctx context.Context, inputGetter func() KCPAdoptionSpecInpu
247247
}
248248
Expect(secrets.Items).To(HaveLen(4 /* pki */ + 1 /* kubeconfig */ + int(*replicas)))
249249

250+
Byf("Verify v1beta2 Available and Ready conditions (if exist) to be true for Cluster and Machines")
251+
verifyV1Beta2Conditions(ctx, input.BootstrapClusterProxy.GetClient(), cluster.Name, cluster.Namespace,
252+
map[string]struct{}{
253+
clusterv1.AvailableCondition: {}, clusterv1.ReadyCondition: {},
254+
})
255+
250256
By("PASSED!")
251257
})
252258

test/e2e/kcp_remediations.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,12 @@ func KCPRemediationSpec(ctx context.Context, inputGetter func() KCPRemediationSp
413413

414414
By("CP BACK TO FULL OPERATIONAL STATE!")
415415

416+
Byf("Verify v1beta2 Available and Ready conditions (if exist) to be true for Cluster and Machines")
417+
verifyV1Beta2Conditions(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster.Name, clusterResources.Cluster.Namespace,
418+
map[string]struct{}{
419+
clusterv1.AvailableCondition: {}, clusterv1.ReadyCondition: {},
420+
})
421+
416422
By("PASSED!")
417423
})
418424

0 commit comments

Comments
 (0)