@@ -260,8 +260,11 @@ var _ = g.Describe("[sig-network-edge][OCPFeatureGate:GatewayAPIController][Feat
260
260
waitForIstioHealthy (oc )
261
261
waitIstioErr := wait .PollUntilContextTimeout (context .Background (), 1 * time .Second , 5 * time .Minute , false , func (context context.Context ) (bool , error ) {
262
262
istioEnv , err := oc .AsAdmin ().Run ("get" ).Args ("-n" , "openshift-ingress" , "istio" , "openshift-gateway" , "-o=jsonpath={.spec.values.pilot.env}" ).Output ()
263
- o .Expect (err ).NotTo (o .HaveOccurred ())
264
- if strings .Contains (istioEnv , `ENABLE_GATEWAY_API_INFERENCE_EXTENSION":"true` ) {
263
+ if err != nil {
264
+ e2e .Logf ("Failed getting openshift-gateway istio cr: %v" , err )
265
+ return false , nil
266
+ }
267
+ if strings .Contains (istioEnv , `"ENABLE_GATEWAY_API_INFERENCE_EXTENSION":"true"` ) {
265
268
e2e .Logf ("GIE has been enabled, and the env variable is present in Istio resource" )
266
269
return true , nil
267
270
}
@@ -275,8 +278,11 @@ var _ = g.Describe("[sig-network-edge][OCPFeatureGate:GatewayAPIController][Feat
275
278
o .Expect (err ).NotTo (o .HaveOccurred ())
276
279
waitIstioErr = wait .PollUntilContextTimeout (context .Background (), 1 * time .Second , 5 * time .Minute , false , func (context context.Context ) (bool , error ) {
277
280
istioEnv , err := oc .AsAdmin ().Run ("get" ).Args ("-n" , "openshift-ingress" , "istio" , "openshift-gateway" , "-o=jsonpath={.spec.values.pilot.env}" ).Output ()
278
- o .Expect (err ).NotTo (o .HaveOccurred ())
279
- if strings .Contains (istioEnv , `ENABLE_GATEWAY_API_INFERENCE_EXTENSION":"true` ) {
281
+ if err != nil {
282
+ e2e .Logf ("Failed getting openshift-gateway istio cr: %v" , err )
283
+ return false , nil
284
+ }
285
+ if strings .Contains (istioEnv , `"ENABLE_GATEWAY_API_INFERENCE_EXTENSION":"true"` ) {
280
286
e2e .Logf ("GIE env variable is still present, trying again..." )
281
287
return false , nil
282
288
}
@@ -307,7 +313,10 @@ func waitForIstioHealthy(oc *exutil.CLI) {
307
313
resource := types.NamespacedName {Namespace : "openshift-ingress" , Name : "openshift-gateway" }
308
314
err := wait .PollUntilContextTimeout (context .Background (), 1 * time .Second , 10 * time .Minute , false , func (context context.Context ) (bool , error ) {
309
315
istioStatus , errIstio := oc .AsAdmin ().Run ("get" ).Args ("-n" , resource .Namespace , "istio" , resource .Name , "-o=jsonpath={.status.state}" ).Output ()
310
- o .Expect (errIstio ).NotTo (o .HaveOccurred ())
316
+ if errIstio != nil {
317
+ e2e .Logf ("Failed getting openshift-gateway istio cr status: %v" , errIstio )
318
+ return false , nil
319
+ }
311
320
if istioStatus != "Healthy" {
312
321
e2e .Logf ("Istio CR %q is not healthy, retrying..." , resource .Name )
313
322
return false , nil
0 commit comments