From 7a00e60fb6f0a1c2f635a701fdc1e37f4a090be6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 08:26:44 +0000 Subject: [PATCH 1/3] Initial plan From 0e8a9cdd84e523b10b342ea350a7c8026d47e7fc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 08:29:39 +0000 Subject: [PATCH 2/3] Add validation for HTTPRoute hosts requirement Co-authored-by: andibeuge <97287249+andibeuge@users.noreply.github.com> --- parcellab/common/templates/_httproutes.tpl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/parcellab/common/templates/_httproutes.tpl b/parcellab/common/templates/_httproutes.tpl index 4968f8a..5eaf756 100644 --- a/parcellab/common/templates/_httproutes.tpl +++ b/parcellab/common/templates/_httproutes.tpl @@ -17,6 +17,10 @@ {{- $securityLabelKey := printf "%s/security-required" (include "common.parcellabtagsdomain" .) -}} {{- range $index, $route := $httproutes }} +{{- $hosts := required (printf "envoy.httpRoutes[%d].hosts is required" $index) $route.hosts -}} +{{- if not $hosts -}} +{{- fail (printf "envoy.httpRoutes[%d].hosts cannot be empty" $index) -}} +{{- end -}} {{- $rawRouteName := default (printf "%s-%d" $baseName $index) $route.name -}} {{- $sanitizedRouteName := trunc 63 (trimSuffix "-" (regexReplaceAll "[^a-z0-9-]" (lower $rawRouteName) "-")) -}} {{- $routeName := default (printf "%s-%d" $baseName $index) $sanitizedRouteName }} @@ -34,7 +38,7 @@ metadata: {{- end }} annotations: external-dns.alpha.kubernetes.io/hostname: | - {{- range $route.hosts }} + {{- range $hosts }} {{ . }} {{- end }} spec: @@ -44,7 +48,7 @@ spec: group: gateway.networking.k8s.io kind: Gateway hostnames: - {{- range $route.hosts }} + {{- range $hosts }} - {{ . | quote }} {{- end }} {{- with $route.rules }} From ee86a0cd5512c90315e6cf065a5c0d2bb1c6aae3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 08:31:54 +0000 Subject: [PATCH 3/3] Use idiomatic len check for empty hosts validation Co-authored-by: andibeuge <97287249+andibeuge@users.noreply.github.com> --- parcellab/common/templates/_httproutes.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parcellab/common/templates/_httproutes.tpl b/parcellab/common/templates/_httproutes.tpl index 5eaf756..7a5ad9f 100644 --- a/parcellab/common/templates/_httproutes.tpl +++ b/parcellab/common/templates/_httproutes.tpl @@ -18,7 +18,7 @@ {{- range $index, $route := $httproutes }} {{- $hosts := required (printf "envoy.httpRoutes[%d].hosts is required" $index) $route.hosts -}} -{{- if not $hosts -}} +{{- if eq (len $hosts) 0 -}} {{- fail (printf "envoy.httpRoutes[%d].hosts cannot be empty" $index) -}} {{- end -}} {{- $rawRouteName := default (printf "%s-%d" $baseName $index) $route.name -}}