diff --git a/exp/controllers/awsmachinepool_controller_test.go b/exp/controllers/awsmachinepool_controller_test.go index 02dfae1911..616213e2e2 100644 --- a/exp/controllers/awsmachinepool_controller_test.go +++ b/exp/controllers/awsmachinepool_controller_test.go @@ -913,6 +913,12 @@ func TestAWSMachinePoolReconciler(t *testing.T) { }, } g.Expect(testEnv.Create(ctx, newBootstrapSecret)).To(Succeed()) + g.Eventually(func(gomega Gomega) { + gomega.Expect(testEnv.Client.Get(ctx, client.ObjectKey{ + Name: newBootstrapSecret.Name, + Namespace: newBootstrapSecret.Namespace, + }, newBootstrapSecret)).To(Succeed()) + }).Should(Succeed()) ms.MachinePool.Spec.Template.Spec.Bootstrap.DataSecretName = ptr.To[string](newBootstrapSecret.Name) // Since `AWSMachinePool.status.launchTemplateVersion` isn't set yet,