From c3501012d416bf8f9ca6e639e08f9b870a317786 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Sun, 6 Jul 2025 10:57:42 +0200 Subject: [PATCH] fix(common): fix gluten trying to fetch empty variables Signed-off-by: Kjeld Schouten --- charts/library/common/templates/addons/_gluetun.tpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/library/common/templates/addons/_gluetun.tpl b/charts/library/common/templates/addons/_gluetun.tpl index 860fcfd3fd1..cae8ebcc1bf 100644 --- a/charts/library/common/templates/addons/_gluetun.tpl +++ b/charts/library/common/templates/addons/_gluetun.tpl @@ -11,7 +11,11 @@ It will include / inject the required templates based on the given values. {{- $fw := $glue.container.env.FIREWALL -}} {{- if (eq $fw "on") -}} - {{- $nets := $glue.container.env.FIREWALL_OUTBOUND_SUBNETS | splitList "," -}} + {{- if and (hasKey $glue.container.env "FIREWALL_OUTBOUND_SUBNETS") (ne $glue.container.env.FIREWALL_OUTBOUND_SUBNETS "") -}} + {{- $nets := splitList "," $glue.container.env.FIREWALL_OUTBOUND_SUBNETS }} + {{- else -}} + {{- $nets := list -}} + {{- end -}} {{- $nets = mustAppend ($nets $.Values.chartContext.podCIDR $.Values.chartContext.svcCIDR) | mustUniq -}} {{- $_ := set $glue.container.env "FIREWALL_OUTBOUND_SUBNETS" (join "," $nets) -}}