Skip to content

Commit

Permalink
test/e2e: fix ClusterClass changes flake
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Büringer [email protected]
  • Loading branch information
sbueringer committed Nov 22, 2022
1 parent c148261 commit 979032a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/e2e/clusterclass_changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,12 @@ func rebaseClusterClassAndWait(ctx context.Context, input rebaseClusterClassAndW
patchHelper, err := patch.NewHelper(input.Cluster, mgmtClient)
Expect(err).ToNot(HaveOccurred())
input.Cluster.Spec.Topology.Class = newClusterClassName
Expect(patchHelper.Patch(ctx, input.Cluster)).To(Succeed())
// We have to retry the patch. The ClusterClass was just created so the client cache in the
// controller/webhook might not be aware of it yet. If the webhook is not aware of the ClusterClass
// we get a "Cluster ... can't be validated. ClusterClass ... can not be retrieved" error.
Eventually(func() error {
return patchHelper.Patch(ctx, input.Cluster)
}, "1m", "5s").Should(Succeed(), "Failed to patch Cluster")

log.Logf("Waiting for MachineDeployment rollout to complete.")
for _, mdTopology := range input.Cluster.Spec.Topology.Workers.MachineDeployments {
Expand Down

0 comments on commit 979032a

Please sign in to comment.