Skip to content

Commit

Permalink
Add wait for MachineList to be available
Browse files Browse the repository at this point in the history
Signed-off-by: muhammad adil ghaffar <muhammad.adil.ghaffar@est.tech>
  • Loading branch information
adilGhaffarDev committed Mar 18, 2024
1 parent 55a6f44 commit 5d0b880
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/e2e/clusterctl_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,24 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
input.PostUpgrade(managementClusterProxy, workloadClusterNamespace, managementClusterName)
}

// After the upgrade check that MachineList is available.
Byf("[%d] Waiting for MachineList to be available", i)
Eventually(func() error {
postUpgradeMachineList := &unstructured.UnstructuredList{}
postUpgradeMachineList.SetGroupVersionKind(schema.GroupVersionKind{
Group: clusterv1.GroupVersion.Group,
Version: coreCAPIStorageVersion,
Kind: "MachineList",
})
err = managementClusterProxy.GetClient().List(
ctx,
postUpgradeMachineList,
client.InNamespace(workloadCluster.GetNamespace()),
client.MatchingLabels{clusterv1.ClusterNameLabel: workloadCluster.GetName()},
)
return err
}, "3m", "30s").ShouldNot(HaveOccurred(), "MachineList should be available after the upgrade")

// After the upgrade check that there were no unexpected rollouts.
Byf("[%d] Verify there are no unexpected rollouts", i)
Consistently(func() bool {
Expand Down

0 comments on commit 5d0b880

Please sign in to comment.