From 781be3a40a7015841d9805c749a92e8055bb958f Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Sat, 6 Jan 2024 01:14:58 -0600 Subject: [PATCH] fix HTTP 409 flake in AKS Cluster Class test --- test/e2e/aks_clusterclass.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/e2e/aks_clusterclass.go b/test/e2e/aks_clusterclass.go index 9fc939cacf2..c2e89bc2d98 100644 --- a/test/e2e/aks_clusterclass.go +++ b/test/e2e/aks_clusterclass.go @@ -31,6 +31,7 @@ import ( infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" + "sigs.k8s.io/controller-runtime/pkg/client" ) type AKSClusterClassInput struct { @@ -102,6 +103,8 @@ func AKSClusterClassSpec(ctx context.Context, inputGetter func() AKSClusterClass By("Upgrading the cluster topology version") Eventually(func(g Gomega) { + err := mgmtClient.Get(ctx, client.ObjectKeyFromObject(input.Cluster), input.Cluster) + g.Expect(err).NotTo(HaveOccurred()) input.Cluster.Spec.Topology.Version = input.KubernetesVersionUpgradeTo g.Expect(mgmtClient.Update(ctx, input.Cluster)).To(Succeed()) }, inputGetter().WaitIntervals...).Should(Succeed())