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 21, 2024
1 parent 55a6f44 commit 882933e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/e2e/clusterctl_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,25 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
input.PostUpgrade(managementClusterProxy, workloadClusterNamespace, managementClusterName)
}

// After the upgrade check that MachineList is available. This ensures the APIServer is serving without
// error before checking that it `Consistently` returns the MachineList later on.
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 882933e

Please sign in to comment.