Skip to content

Commit dd8a006

Browse files
committed
Fix GRPCRoute check in tests (nginx#2100)
Problem: When running the upgrade tests, the grpcroute check fails because they don't exist in the previous version of the API. Solution: Check that grpcroutes even exist first, don't return an error if they don't.
1 parent c788bcb commit dd8a006

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/framework/resourcemanager.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,13 @@ func (rm *ResourceManager) waitForHTTPRoutesToBeReady(ctx context.Context, names
398398
}
399399

400400
func (rm *ResourceManager) waitForGRPCRoutesToBeReady(ctx context.Context, namespace string) error {
401+
// First, check if grpcroute even exists for v1. If not, ignore.
402+
var routeList v1.GRPCRouteList
403+
err := rm.K8sClient.List(ctx, &routeList, client.InNamespace(namespace))
404+
if err != nil && strings.Contains(err.Error(), "no matches for kind") {
405+
return nil
406+
}
407+
401408
return wait.PollUntilContextCancel(
402409
ctx,
403410
500*time.Millisecond,

0 commit comments

Comments
 (0)