Skip IP literals in HTTPRoute hostnames - #1333
Merged
Merged
Conversation
Gateway API requires spec.hostnames[] to be a valid FQDN, so a route templated on an IP platform host (e.g. 10.2.0.76) never matches. The feature charts are installed as standalone releases and have no global.platform to key off, so filter the host value itself; the acaas routes get the same hostType guard route-hosted.yaml already had. Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Gateway API requires
spec.hostnames[]entries to be a valid FQDN — IP addresses are not allowed. On a deployment whose platform host is an IP, charts that copygateway.hosts[].hoststraight intohostnamesemit e.g.:and the routes never match.
charts/acealready avoids this by guarding onglobal.platform.hostType == "domain".Fix
The feature charts (
inbox-ui,dns-proxy,gh-ci-webhook,minio,offline-license-server,s3proxy,service-backend,smtprelay) are installed as their own Helm releases, so they have noglobal.platform— the check is made on the host value itself, dropping IPv4 literals and anything containing:(IPv6).rules:still ranges overgateway.hosts, so path routing is unchanged; the route just becomes hostname-less and matches any Host, same asacedoes on IP deployments.charts/acaas/templates/{learn,license,docs,blog,selfhost}/route.yamlhad the same latent bug — they get thehostType == "domain"guard thatingress/route-hosted.yamlalready carried. No values.yaml keys added.Verification
helm templateper chart with an IP host, an IPv6 host and a domain host: hostnames omitted for the first two, unchanged for the domain.Two pre-existing, unrelated render failures were noticed and left alone:
charts/minio/templates/httproute.yaml:2includesservice-backend.fullname(not defined in that chart) andcharts/s3proxy/templates/httproute.yaml:47callss3proxy.fullnamewith the range scope. Both fail on master too.