@@ -23,6 +23,7 @@ import (
2323	"context" 
2424	"fmt" 
2525	"path/filepath" 
26+ 	"time" 
2627
2728	"github.com/gofrs/flock" 
2829	"github.com/onsi/ginkgo/v2" 
@@ -81,11 +82,30 @@ var _ = ginkgo.Context("[unmanaged] [functional] [ClusterClass]", func() {
8182				WaitForControlPlaneIntervals : e2eCtx .E2EConfig .GetIntervals (specName , "wait-control-plane" ),
8283			}, result )
8384
84- 			ginkgo .By ("Checking if bastion host is running" )
85- 			awsCluster , err  :=  GetAWSClusterByName (ctx , e2eCtx .Environment .BootstrapClusterProxy , namespace .Name , clusterName )
86- 			Expect (err ).To (BeNil ())
87- 			Expect (awsCluster .Status .Bastion .State ).To (Equal (infrav1 .InstanceStateRunning ))
88- 			expectAWSClusterConditions (awsCluster , []conditionAssertion {{infrav1 .BastionHostReadyCondition , corev1 .ConditionTrue , "" , "" }})
85+ 			Eventually (func (gomega  Gomega ) (bool , error ) {
86+ 				ginkgo .By ("Checking if the bastion is ready" )
87+ 				awsCluster , err  :=  GetAWSClusterByName (ctx , e2eCtx .Environment .BootstrapClusterProxy , namespace .Name , clusterName )
88+ 				if  err  !=  nil  {
89+ 					return  false , err 
90+ 				}
91+ 				if  awsCluster .Status .Bastion .State  !=  infrav1 .InstanceStateRunning  {
92+ 					shared .Byf ("Bastion is not running, state is %s" , awsCluster .Status .Bastion .State )
93+ 					return  false , nil 
94+ 				}
95+ 
96+ 				if  ! hasAWSClusterConditions (awsCluster , []conditionAssertion {{infrav1 .BastionHostReadyCondition , corev1 .ConditionTrue , "" , "" }}) {
97+ 					ginkgo .By ("AWSCluster missing bastion host ready condition" )
98+ 					return  false , nil 
99+ 				}
100+ 
101+ 				return  true , nil 
102+ 			}, 15 * time .Minute , 30 * time .Second ).Should (BeTrue (), "Should've eventually succeeded creating bastion host" )
103+ 
104+ 			// ginkgo.By("Checking if bastion host is running") 
105+ 			// awsCluster, err := GetAWSClusterByName(ctx, e2eCtx.Environment.BootstrapClusterProxy, namespace.Name, clusterName) 
106+ 			// Expect(err).To(BeNil()) 
107+ 			// Expect(awsCluster.Status.Bastion.State).To(Equal(infrav1.InstanceStateRunning)) 
108+ 			// expectAWSClusterConditions(awsCluster, []conditionAssertion{{infrav1.BastionHostReadyCondition, corev1.ConditionTrue, "", ""}}) 
89109
90110			ginkgo .By ("PASSED!" )
91111		})
0 commit comments