From b04d4e56e6bcb3b89d2c2ef8fc686014a699b2f3 Mon Sep 17 00:00:00 2001 From: Arnob Kumar Saha Date: Sun, 13 Sep 2026 12:57:22 +0600 Subject: [PATCH] Skip IP literals in HTTPRoute hostnames 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 --- charts/acaas/templates/blog/route.yaml | 2 ++ charts/acaas/templates/docs/route.yaml | 2 ++ charts/acaas/templates/learn/route.yaml | 2 ++ charts/acaas/templates/license/route.yaml | 2 ++ charts/acaas/templates/selfhost/route.yaml | 2 ++ charts/dns-proxy/templates/httproute.yaml | 2 +- charts/gh-ci-webhook/templates/httproute.yaml | 2 +- charts/inbox-ui/templates/httproute.yaml | 2 +- charts/minio/templates/httproute.yaml | 2 +- charts/offline-license-server/templates/httproute.yaml | 2 +- charts/s3proxy/templates/httproute.yaml | 2 +- charts/service-backend/templates/httproute.yaml | 2 +- charts/smtprelay/templates/httproute.yaml | 2 +- 13 files changed, 18 insertions(+), 8 deletions(-) diff --git a/charts/acaas/templates/blog/route.yaml b/charts/acaas/templates/blog/route.yaml index aa6a87ee2..40fe3c741 100644 --- a/charts/acaas/templates/blog/route.yaml +++ b/charts/acaas/templates/blog/route.yaml @@ -15,8 +15,10 @@ spec: name: ace namespace: {{ .Release.Namespace }} sectionName: https + {{- if eq .Values.global.platform.hostType "domain" }} hostnames: - {{ .Values.global.platform.host }} + {{- end }} rules: - matches: - path: diff --git a/charts/acaas/templates/docs/route.yaml b/charts/acaas/templates/docs/route.yaml index f3aba36f5..fb525a37c 100644 --- a/charts/acaas/templates/docs/route.yaml +++ b/charts/acaas/templates/docs/route.yaml @@ -15,8 +15,10 @@ spec: name: ace namespace: {{ .Release.Namespace }} sectionName: https + {{- if eq .Values.global.platform.hostType "domain" }} hostnames: - {{ .Values.global.platform.host }} + {{- end }} rules: - matches: - path: diff --git a/charts/acaas/templates/learn/route.yaml b/charts/acaas/templates/learn/route.yaml index 886afbf88..9ebdcc668 100644 --- a/charts/acaas/templates/learn/route.yaml +++ b/charts/acaas/templates/learn/route.yaml @@ -15,8 +15,10 @@ spec: name: ace namespace: {{ .Release.Namespace }} sectionName: https + {{- if eq .Values.global.platform.hostType "domain" }} hostnames: - {{ .Values.global.platform.host }} + {{- end }} rules: - matches: - path: diff --git a/charts/acaas/templates/license/route.yaml b/charts/acaas/templates/license/route.yaml index 292bfdacf..3cbbf176e 100644 --- a/charts/acaas/templates/license/route.yaml +++ b/charts/acaas/templates/license/route.yaml @@ -15,8 +15,10 @@ spec: name: ace namespace: {{ .Release.Namespace }} sectionName: https + {{- if eq .Values.global.platform.hostType "domain" }} hostnames: - {{ .Values.global.platform.host }} + {{- end }} rules: - matches: - path: diff --git a/charts/acaas/templates/selfhost/route.yaml b/charts/acaas/templates/selfhost/route.yaml index 8d038a204..5399be922 100644 --- a/charts/acaas/templates/selfhost/route.yaml +++ b/charts/acaas/templates/selfhost/route.yaml @@ -15,8 +15,10 @@ spec: name: ace namespace: {{ .Release.Namespace }} sectionName: https + {{- if eq .Values.global.platform.hostType "domain" }} hostnames: - {{ .Values.global.platform.host }} + {{- end }} rules: - matches: - path: diff --git a/charts/dns-proxy/templates/httproute.yaml b/charts/dns-proxy/templates/httproute.yaml index 1e2f6a783..f557cac1e 100644 --- a/charts/dns-proxy/templates/httproute.yaml +++ b/charts/dns-proxy/templates/httproute.yaml @@ -24,7 +24,7 @@ spec: {{- $hostnames := list }} {{- range .Values.gateway.hosts }} - {{- if .host }} + {{- if and .host (not (regexMatch "^([0-9]{1,3}\\.){3}[0-9]{1,3}$" .host)) (not (contains ":" .host)) }} {{- $hostnames = append $hostnames .host }} {{- end }} {{- end }} diff --git a/charts/gh-ci-webhook/templates/httproute.yaml b/charts/gh-ci-webhook/templates/httproute.yaml index f03d31c95..b4533e9ec 100644 --- a/charts/gh-ci-webhook/templates/httproute.yaml +++ b/charts/gh-ci-webhook/templates/httproute.yaml @@ -22,7 +22,7 @@ spec: {{- $hostnames := list }} {{- range .Values.gateway.hosts }} - {{- if .host }} + {{- if and .host (not (regexMatch "^([0-9]{1,3}\\.){3}[0-9]{1,3}$" .host)) (not (contains ":" .host)) }} {{- $hostnames = append $hostnames .host }} {{- end }} {{- end }} diff --git a/charts/inbox-ui/templates/httproute.yaml b/charts/inbox-ui/templates/httproute.yaml index 15c489e35..98379e152 100644 --- a/charts/inbox-ui/templates/httproute.yaml +++ b/charts/inbox-ui/templates/httproute.yaml @@ -3,7 +3,7 @@ {{- $svcPort := .Values.service.port -}} {{- $hostnames := list }} {{- range .Values.gateway.hosts }} - {{- if .host }} + {{- if and .host (not (regexMatch "^([0-9]{1,3}\\.){3}[0-9]{1,3}$" .host)) (not (contains ":" .host)) }} {{- $hostnames = append $hostnames .host }} {{- end }} {{- end }} diff --git a/charts/minio/templates/httproute.yaml b/charts/minio/templates/httproute.yaml index 24b8a1153..343de09de 100644 --- a/charts/minio/templates/httproute.yaml +++ b/charts/minio/templates/httproute.yaml @@ -24,7 +24,7 @@ spec: {{- $hostnames := list }} {{- range .Values.gateway.hosts }} - {{- if .host }} + {{- if and .host (not (regexMatch "^([0-9]{1,3}\\.){3}[0-9]{1,3}$" .host)) (not (contains ":" .host)) }} {{- $hostnames = append $hostnames .host }} {{- end }} {{- end }} diff --git a/charts/offline-license-server/templates/httproute.yaml b/charts/offline-license-server/templates/httproute.yaml index 7d93afc18..7b007b14f 100644 --- a/charts/offline-license-server/templates/httproute.yaml +++ b/charts/offline-license-server/templates/httproute.yaml @@ -22,7 +22,7 @@ spec: {{- $hostnames := list }} {{- range .Values.gateway.hosts }} - {{- if .host }} + {{- if and .host (not (regexMatch "^([0-9]{1,3}\\.){3}[0-9]{1,3}$" .host)) (not (contains ":" .host)) }} {{- $hostnames = append $hostnames .host }} {{- end }} {{- end }} diff --git a/charts/s3proxy/templates/httproute.yaml b/charts/s3proxy/templates/httproute.yaml index 3f2670e48..e389d10be 100644 --- a/charts/s3proxy/templates/httproute.yaml +++ b/charts/s3proxy/templates/httproute.yaml @@ -23,7 +23,7 @@ spec: sectionName: https {{- $hostnames := list }} {{- range .Values.gateway.hosts }} - {{- if .host }} + {{- if and .host (not (regexMatch "^([0-9]{1,3}\\.){3}[0-9]{1,3}$" .host)) (not (contains ":" .host)) }} {{- $hostnames = append $hostnames .host }} {{- end }} {{- end }} diff --git a/charts/service-backend/templates/httproute.yaml b/charts/service-backend/templates/httproute.yaml index 7f44bd975..6500193ec 100644 --- a/charts/service-backend/templates/httproute.yaml +++ b/charts/service-backend/templates/httproute.yaml @@ -24,7 +24,7 @@ spec: {{- $hostnames := list }} {{- range .Values.gateway.hosts }} - {{- if .host }} + {{- if and .host (not (regexMatch "^([0-9]{1,3}\\.){3}[0-9]{1,3}$" .host)) (not (contains ":" .host)) }} {{- $hostnames = append $hostnames .host }} {{- end }} {{- end }} diff --git a/charts/smtprelay/templates/httproute.yaml b/charts/smtprelay/templates/httproute.yaml index bff5e8daa..538f27f5e 100644 --- a/charts/smtprelay/templates/httproute.yaml +++ b/charts/smtprelay/templates/httproute.yaml @@ -24,7 +24,7 @@ spec: {{- $hostnames := list }} {{- range .Values.gateway.hosts }} - {{- if .host }} + {{- if and .host (not (regexMatch "^([0-9]{1,3}\\.){3}[0-9]{1,3}$" .host)) (not (contains ":" .host)) }} {{- $hostnames = append $hostnames .host }} {{- end }} {{- end }}