Skip to content
4 changes: 2 additions & 2 deletions internal/controller/nginx/conf/nginx-plus.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ events {
http {
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/mime.types;
js_import /usr/lib/nginx/modules/njs/httpmatches.js;
js_import /usr/lib/nginx/modules/njs/epp.js;
js_import modules/njs/httpmatches.js;
js_import modules/njs/epp.js;

default_type application/octet-stream;

Expand Down
4 changes: 2 additions & 2 deletions internal/controller/nginx/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ events {
http {
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/mime.types;
js_import /usr/lib/nginx/modules/njs/httpmatches.js;
js_import /usr/lib/nginx/modules/njs/epp.js;
js_import modules/njs/httpmatches.js;
js_import modules/njs/epp.js;

default_type application/octet-stream;

Expand Down
10 changes: 6 additions & 4 deletions internal/controller/state/graph/httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
r.Attachable = true

rules, valid, conds := processHTTPRouteRules(
ghr.Spec.Rules,
ghr,
validator,
getSnippetsFilterResolverForNamespace(snippetsFilters, r.Source.GetNamespace()),
inferencePools,
Expand Down Expand Up @@ -170,11 +170,12 @@

func processHTTPRouteRule(
specRule v1.HTTPRouteRule,
routeNamespace string,

Check failure on line 173 in internal/controller/state/graph/httproute.go

View workflow job for this annotation

GitHub Actions / Go Lint (.)

other declaration of routeNamespace
rulePath *field.Path,
validator validation.HTTPFieldsValidator,
resolveExtRefFunc resolveExtRefFilter,
inferencePools map[types.NamespacedName]*inference.InferencePool,
routeNamespace string,

Check failure on line 178 in internal/controller/state/graph/httproute.go

View workflow job for this annotation

GitHub Actions / Go Lint (.)

routeNamespace redeclared in this block
) (RouteRule, routeRuleErrors) {
var errors routeRuleErrors

Expand Down Expand Up @@ -280,24 +281,25 @@
}

func processHTTPRouteRules(
specRules []v1.HTTPRouteRule,
route *v1.HTTPRoute,
validator validation.HTTPFieldsValidator,
resolveExtRefFunc resolveExtRefFilter,
inferencePools map[types.NamespacedName]*inference.InferencePool,
routeNamespace string,
) (rules []RouteRule, valid bool, conds []conditions.Condition) {
rules = make([]RouteRule, len(specRules))
rules = make([]RouteRule, len(route.Spec.Rules))

var (
allRulesErrors routeRuleErrors
atLeastOneValid bool
)

for i, rule := range specRules {
for i, rule := range route.Spec.Rules {
rulePath := field.NewPath("spec").Child("rules").Index(i)

rr, errors := processHTTPRouteRule(
rule,
route.GetNamespace(),
rulePath,
validator,
resolveExtRefFunc,
Expand Down
Loading