Skip to content

Commit 76d4673

Browse files
committed
address team comments
1 parent a82a19a commit 76d4673

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

test/extended/router/gatewayapicontroller.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,11 @@ var _ = g.Describe("[sig-network-edge][OCPFeatureGate:GatewayAPIController][Feat
260260
waitForIstioHealthy(oc)
261261
waitIstioErr := wait.PollUntilContextTimeout(context.Background(), 1*time.Second, 5*time.Minute, false, func(context context.Context) (bool, error) {
262262
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"`) {
265268
e2e.Logf("GIE has been enabled, and the env variable is present in Istio resource")
266269
return true, nil
267270
}
@@ -275,8 +278,11 @@ var _ = g.Describe("[sig-network-edge][OCPFeatureGate:GatewayAPIController][Feat
275278
o.Expect(err).NotTo(o.HaveOccurred())
276279
waitIstioErr = wait.PollUntilContextTimeout(context.Background(), 1*time.Second, 5*time.Minute, false, func(context context.Context) (bool, error) {
277280
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"`) {
280286
e2e.Logf("GIE env variable is still present, trying again...")
281287
return false, nil
282288
}
@@ -307,7 +313,10 @@ func waitForIstioHealthy(oc *exutil.CLI) {
307313
resource := types.NamespacedName{Namespace: "openshift-ingress", Name: "openshift-gateway"}
308314
err := wait.PollUntilContextTimeout(context.Background(), 1*time.Second, 10*time.Minute, false, func(context context.Context) (bool, error) {
309315
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+
}
311320
if istioStatus != "Healthy" {
312321
e2e.Logf("Istio CR %q is not healthy, retrying...", resource.Name)
313322
return false, nil

0 commit comments

Comments
 (0)