Skip to content

Commit

Permalink
Merge pull request #10301 from Nordix/clusterctl-flake-fix/adil
Browse files Browse the repository at this point in the history
🐛 Add wait for MachineList to be available
  • Loading branch information
k8s-ci-robot committed Mar 26, 2024
2 parents 3d27cc7 + 882933e commit fe7847b
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 fe7847b

Please sign in to comment.