Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Add wait for MachineList to be available #10301

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading