envoyproxy / envoyproxy/gateway
is isHTTPRouteFilterReferencingSecret too eager ?
- Dominant language
- Go
- Stars
- 3k
- Forks
- 864
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 140
Description
*Description*:
i found a weird piece of code when browing candidly
```go
func (r *gatewayAPIReconciler) isHTTPRouteFilterReferencingSecret(nsName *types.NamespacedName) bool {
routeFilterList := &egv1a1.HTTPRouteFilterList{}
if err := r.client.List(context.Background(), routeFilterList, &client.ListOptions{
FieldSelector: fields.OneTermEqualSelector(secretHTTPRouteFilterIndex, nsName.String()),
}); err != nil {
r.log.Error(err, "unable to find associated HTTPRouteFilter")
return false
}
if len(routeFilterList.Items) > 0 {
return true
}
return true
}
```
the filter always return true, wouldn't that cause the filter to be a bit too eager ?
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate isHTTPRouteFilterReferencingSecret in the Go gateway API reconciler and inspect its callers and nearby tests. Verify the intended result for an empty HTTPRouteFilterList, add coverage for both empty and non-empty results, and run the relevant Go tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100