@@ -204,10 +204,29 @@ var _ = ginkgo.Context("[unmanaged] [functional]", func() {
204204 }, result )
205205
206206 // Check if bastion host is up and running
207- awsCluster , err := GetAWSClusterByName (ctx , e2eCtx .Environment .BootstrapClusterProxy , namespace .Name , clusterName )
208- Expect (err ).To (BeNil ())
209- Expect (awsCluster .Status .Bastion .State ).To (Equal (infrav1 .InstanceStateRunning ))
210- expectAWSClusterConditions (awsCluster , []conditionAssertion {{infrav1 .BastionHostReadyCondition , corev1 .ConditionTrue , "" , "" }})
207+ Eventually (func (gomega Gomega ) (bool , error ) {
208+ ginkgo .By ("Checking if the bastion is ready" )
209+ awsCluster , err := GetAWSClusterByName (ctx , e2eCtx .Environment .BootstrapClusterProxy , namespace .Name , clusterName )
210+ if err != nil {
211+ return false , err
212+ }
213+ if awsCluster .Status .Bastion .State != infrav1 .InstanceStateRunning {
214+ shared .Byf ("Bastion is not running, state is %s" , awsCluster .Status .Bastion .State )
215+ return false , nil
216+ }
217+
218+ if ! hasAWSClusterConditions (awsCluster , []conditionAssertion {{infrav1 .BastionHostReadyCondition , corev1 .ConditionTrue , "" , "" }}) {
219+ ginkgo .By ("AWSCluster missing bastion host ready condition" )
220+ return false , nil
221+ }
222+
223+ return true , nil
224+ }, 15 * time .Minute , 30 * time .Second ).Should (BeTrue (), "Should've eventually succeeded creating bastion host" )
225+
226+ // awsCluster, err := GetAWSClusterByName(ctx, e2eCtx.Environment.BootstrapClusterProxy, namespace.Name, clusterName)
227+ // Expect(err).To(BeNil())
228+ // Expect(awsCluster.Status.Bastion.State).To(Equal(infrav1.InstanceStateRunning))
229+ // expectAWSClusterConditions(awsCluster, []conditionAssertion{{infrav1.BastionHostReadyCondition, corev1.ConditionTrue, "", ""}})
211230
212231 mdName := clusterName + "-md01"
213232 machineTempalte := makeAWSMachineTemplate (namespace .Name , mdName , e2eCtx .E2EConfig .GetVariable (shared .AwsNodeMachineType ), nil )
0 commit comments