@@ -307,15 +307,8 @@ func (c *gatewayRouteResolver) resolve(rt gatewayRoute) (map[string]endpoint.Tar
307
307
for _ , rps := range rt .RouteStatus ().Parents {
308
308
// Confirm the Parent is the standard Gateway kind.
309
309
ref := rps .ParentRef
310
-
311
310
namespace := strVal ((* string )(ref .Namespace ), meta .Namespace )
312
311
313
- // Ensure that the parent reference is for the current generation
314
- if len (rps .Conditions ) > 0 && rps .Conditions [0 ].ObservedGeneration != meta .Generation {
315
- log .Debugf ("Ignoring parent %s/%s of %s/%s as generation %d does not match current generation %d" , namespace , ref .Name , meta .Namespace , meta .Name , rps .Conditions [0 ].ObservedGeneration , meta .Generation )
316
- continue
317
- }
318
-
319
312
// Ensure that the parent reference is in the routeParentRefs list
320
313
if ! gwRouteHasParentRef (routeParentRefs , ref , meta ) {
321
314
log .Debugf ("Parent reference %s/%s not found in routeParentRefs for %s %s/%s" , namespace , string (ref .Name ), c .src .rtKind , meta .Namespace , meta .Name )
@@ -341,10 +334,11 @@ func (c *gatewayRouteResolver) resolve(rt gatewayRoute) (map[string]endpoint.Tar
341
334
}
342
335
343
336
// Confirm the Gateway has accepted the Route.
344
- if ! gwRouteIsAccepted (rps .Conditions ) {
345
- log .Debugf ("Gateway %s/%s has not accepted %s %s/%s" , namespace , ref .Name , c .src .rtKind , meta .Namespace , meta .Name )
337
+ if ! gwRouteIsAccepted (rps .Conditions , meta ) {
338
+ log .Debugf ("Gateway %s/%s has not accepted the current generation %s %s/%s" , namespace , ref .Name , c .src .rtKind , meta .Namespace , meta .Name )
346
339
continue
347
340
}
341
+
348
342
// Match the Route to all possible Listeners.
349
343
match := false
350
344
section := sectionVal (ref .SectionName , "" )
@@ -502,10 +496,10 @@ func gwRouteHasParentRef(routeParentRefs []v1.ParentReference, ref v1.ParentRefe
502
496
return false
503
497
}
504
498
505
- func gwRouteIsAccepted (conds []metav1.Condition ) bool {
499
+ func gwRouteIsAccepted (conds []metav1.Condition , meta * metav1. ObjectMeta ) bool {
506
500
for _ , c := range conds {
507
501
if v1 .RouteConditionType (c .Type ) == v1 .RouteConditionAccepted {
508
- return c .Status == metav1 .ConditionTrue
502
+ return c .Status == metav1 .ConditionTrue && c . ObservedGeneration == meta . Generation
509
503
}
510
504
}
511
505
return false
0 commit comments