Skip to content

Commit c7603ba

Browse files
committed
Add comments
1 parent fb84469 commit c7603ba

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

internal/controller/nginx/config/servers.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ func createLocations(
379379
)
380380
httpMatchKey := serverID + "_" + strconv.Itoa(pathRuleIdx)
381381
for i := range extLocations {
382+
// FIXME(sberman): De-dupe matches and associated locations
383+
// so we don't need nginx/njs to perform unnecessary matching.
384+
// https://github.com/nginx/nginx-gateway-fabric/issues/662
382385
extLocations[i].HTTPMatchKey = httpMatchKey
383386
matchPairs[extLocations[i].HTTPMatchKey] = matches
384387
}
@@ -615,8 +618,8 @@ func getLocationTypeForPathRule(rule dataplane.PathRule) http.LocationType {
615618
return http.ExternalLocationType
616619
}
617620

618-
// initializes the internal location that is redirected to by an external location HTTP matching decision.
619-
// This location will proxy_pass to the backend.
621+
// initializeInternalMatchLocation initializes the internal location that is redirected to by an
622+
// external location HTTP matching decision. This location will proxy_pass to the backend.
620623
func initializeInternalMatchLocation(
621624
pathruleIdx,
622625
matchRuleIdx int,
@@ -627,7 +630,7 @@ func initializeInternalMatchLocation(
627630
return createMatchLocation(path, grpc), createRouteMatch(match, path)
628631
}
629632

630-
// initializes the internal inference location that is redirected to by
633+
// initializeInternalInferenceRedirectLocation initializes the internal inference location that is redirected to by
631634
// an external HTTP matching location. This location then redirects to the final proxy_pass location.
632635
func initializeInternalInferenceRedirectLocation(pathruleIdx, matchRuleIdx int) http.Location {
633636
return http.Location{
@@ -636,8 +639,9 @@ func initializeInternalInferenceRedirectLocation(pathruleIdx, matchRuleIdx int)
636639
}
637640
}
638641

639-
// initializes the internal location that is redirected to by an internal inference location, which was
640-
// redirected to by the external HTTP matching location. This location will proxy_pass to the backend.
642+
// initializeInternalMatchLocationWithInference initializes the internal location that is redirected to by
643+
// an internal inference location, which was redirected to by the external HTTP matching location.
644+
// This location will proxy_pass to the backend.
641645
// The routeMatch is created with the inference internal location path, so that the HTTP match in the external
642646
// location can redirect to the proper inference location, which then redirects to this location.
643647
func initializeInternalMatchLocationWithInference(
@@ -651,7 +655,8 @@ func initializeInternalMatchLocationWithInference(
651655
return createMatchLocation(path, grpc), createRouteMatch(match, inferencePath(pathruleIdx, matchRuleIdx))
652656
}
653657

654-
// initializes the internal inference location that does the final proxy_pass to the inference backend.
658+
// initializeInternalInferenceLocation initializes the internal inference location that does the final
659+
// proxy_pass to the inference backend.
655660
// This is used when the external location redirects directly here, without any HTTP matching.
656661
func initializeInternalInferenceLocation(pathruleIdx, matchRuleIdx int) http.Location {
657662
return http.Location{

0 commit comments

Comments
 (0)