Skip to content

Commit

Permalink
Merge pull request #7579 from sbueringer/pr-fix-cc-changes-flake
Browse files Browse the repository at this point in the history
🐛 test/e2e: fix ClusterClass changes flake
  • Loading branch information
k8s-ci-robot authored Nov 22, 2022
2 parents b168862 + 979032a commit 9bd545c
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 9bd545c

Please sign in to comment.