Skip to content

Commit

Permalink
Fix GRPCRoute check in tests (#2100)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sjberman authored Jun 5, 2024
1 parent e0c1275 commit 23f75a4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/framework/resourcemanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,13 @@ func (rm *ResourceManager) waitForHTTPRoutesToBeReady(ctx context.Context, names
}

func (rm *ResourceManager) waitForGRPCRoutesToBeReady(ctx context.Context, namespace string) error {
// First, check if grpcroute even exists for v1. If not, ignore.
var routeList v1.GRPCRouteList
err := rm.K8sClient.List(ctx, &routeList, client.InNamespace(namespace))
if err != nil && strings.Contains(err.Error(), "no matches for kind") {
return nil
}

return wait.PollUntilContextCancel(
ctx,
500*time.Millisecond,
Expand Down

0 comments on commit 23f75a4

Please sign in to comment.