Skip to content

Commit

Permalink
add comments about pending upstream discussions
Browse files Browse the repository at this point in the history
  • Loading branch information
randmonkey committed Nov 30, 2022
1 parent 8cd4800 commit 99c5959
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/controllers/gateway/httproute_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func (r *HTTPRouteReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
ctx,
httproute, gateways,
metav1.ConditionFalse,
RouteReasonNoMatchingListenerHostname,
gatewayv1beta1.RouteReasonNoMatchingListenerHostname,
err.Error(),
)
if err != nil {
Expand Down
9 changes: 4 additions & 5 deletions internal/controllers/gateway/route_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ const (
// https://github.com/kubernetes-sigs/gateway-api/pull/1516
// TODO: swap this out with upstream const when released.
RouteReasonNoMatchingParent gatewayv1beta1.RouteConditionReason = "NoMatchingParent"
// This reason is used with the "Accepted" condition when no hostnames in listeners
// could match hostname in the spec of route.
RouteReasonNoMatchingListenerHostname gatewayv1beta1.RouteConditionReason = "NoMatchingListenerHostname"
)

// getSupportedGatewayForRoute will retrieve the Gateway and GatewayClass object for any
Expand Down Expand Up @@ -463,7 +460,7 @@ func listenerHostnameIntersectWithRouteHostnames[H types.HostnameT, L types.List
return false
}

// isListenterHostnameEffective returns true if the listener can specify an effective
// isListenerHostnameEffective returns true if the listener can specify an effective
// hostname to match hostnames in requests.
// It basically checks if the listener is using any these protocols: HTTP, HTTPS, or TLS.
func isListenerHostnameEffective(listener gatewayv1beta1.Listener) bool {
Expand Down Expand Up @@ -520,7 +517,9 @@ func getUnionOfGatewayHostnames(gateways []supportedGatewayWithCondition) ([]gat
}
} else {
for _, listener := range gateway.gateway.Spec.Listeners {
// REVIEW: which listeners should we take into consideration here if no listener in supported gateways?
// here we consider ALL listeners that are able to configure a hostname if no listener attached.
// may be changed if there is a conclusion on the upstream discussion about it:
// https://github.com/kubernetes-sigs/gateway-api/discussions/1563
if isListenerHostnameEffective(listener) {
if listener.Hostname == nil {
return nil, true
Expand Down

0 comments on commit 99c5959

Please sign in to comment.