Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow wildcard (empty) hostname GWAPI Routes #4526

Closed
2 tasks
rainest opened this issue Aug 17, 2023 · 0 comments · Fixed by #4528
Closed
2 tasks

Allow wildcard (empty) hostname GWAPI Routes #4526

rainest opened this issue Aug 17, 2023 · 0 comments · Fixed by #4528
Assignees
Labels
area/debt area/gateway-api Relating to upstream Kubernetes SIG Networking Gateway API
Milestone

Comments

@rainest
Copy link
Contributor

rainest commented Aug 17, 2023

From #4512 (comment)

HTTPRoute and GRPCRoute translators drop Routes with no Hostname values. However, this field is optional, and there is no language indicating that empty Hostname Routes should be discarded. Listener documentation around Hostname indicates that empty is the universal wildcard, so I'd expect that applies to Routes also:

As a special case, one Listener within a group may omit Hostname, in which case this Listener matches when no other Listener matches.

Kong does support empty hostname routes and matches requests to them regardless of hostname.

generateKongRoutesFromHTTPRouteRule via ingressRulesFromHTTPRouteLegacyFallback would generate any-hostname rules, as it's just collecting the list of hostnames (which may be empty) before iterating over the rules.

Comparatively, generateKongRoutesFromHTTPRouteMatches via ingressRulesFromHTTPRouteWithCombinedServiceRoutes

I did not review ATC in depth, but I believe it has the same restriction (GRPCRoute did when I reviewed a related PR).

Although legacy handling does appear to allow empty hostnames, this restriction appears to be fairly old, however, so it's not quite clear how we ended up with that discrepancy. Regardless, we should allow empty hostname Routes.

Acceptance:

  • KIC accepts HTTPRoutes and GRPCRoutes with no Hostname value.
  • KIC generates Kong routes with no hostname from the rules of HTTPRoutes and GRPCRoutes with no Hostname value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/debt area/gateway-api Relating to upstream Kubernetes SIG Networking Gateway API
Projects
None yet
2 participants