Skip to content

Commit

Permalink
chore: address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Lavacca <[email protected]>
  • Loading branch information
mlavacca committed Jun 19, 2024
1 parent 6a5236c commit eaf739d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controller/gateway/controller_reconciler_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,11 @@ func countAttachedRoutesForGatewayListener(ctx context.Context, g *gwtypes.Gatew
return count, nil
}

// countAttachedHTTPRoutes counts the number of attached HTTPRoutes for a given listener,
// taking into account the ParentRefs' sectionName.
func countAttachedHTTPRoutes(listenerName gatewayv1.SectionName, httpRoutes []gatewayv1.HTTPRoute) int32 {
var count int32

for _, httpRoute := range httpRoutes {
if lo.ContainsBy(httpRoute.Spec.ParentRefs, func(item gatewayv1.ParentReference) bool {
return item.SectionName == nil || *item.SectionName == listenerName
Expand Down

0 comments on commit eaf739d

Please sign in to comment.