Skip to content

Commit

Permalink
check if httproutefilter crd exists
Browse files Browse the repository at this point in the history
Signed-off-by: Guy Daich <[email protected]>
  • Loading branch information
guydc authored and zirain committed Jan 6, 2025
1 parent 2be279e commit eb9b2db
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions internal/provider/kubernetes/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,17 @@ func (r *gatewayAPIReconciler) processHTTPRoutes(ctx context.Context, gatewayNam

switch string(filter.ExtensionRef.Kind) {
case egv1a1.KindHTTPRouteFilter:
httpFilter, err := r.getHTTPRouteFilter(ctx, key.Name, key.Namespace)
if err != nil {
r.log.Error(err, "HTTPRouteFilters not found; bypassing rule", "index", i)
continue
}
if !resourceMap.allAssociatedHTTPRouteExtensionFilters.Has(key) {
r.processRouteFilterConfigMapRef(ctx, httpFilter, resourceMap, resourceTree)
resourceMap.allAssociatedHTTPRouteExtensionFilters.Insert(key)
resourceTree.HTTPRouteFilters = append(resourceTree.HTTPRouteFilters, httpFilter)
if r.hrfCRDExists {
httpFilter, err := r.getHTTPRouteFilter(ctx, key.Name, key.Namespace)
if err != nil {
r.log.Error(err, "HTTPRouteFilters not found; bypassing rule", "index", i)
continue
}
if !resourceMap.allAssociatedHTTPRouteExtensionFilters.Has(key) {
r.processRouteFilterConfigMapRef(ctx, httpFilter, resourceMap, resourceTree)
resourceMap.allAssociatedHTTPRouteExtensionFilters.Insert(key)
resourceTree.HTTPRouteFilters = append(resourceTree.HTTPRouteFilters, httpFilter)
}
}
default:
extRefFilter, ok := resourceMap.extensionRefFilters[key]
Expand Down

0 comments on commit eb9b2db

Please sign in to comment.