From 880045eb27106393e23d2ccb38db49bfe895161c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfred=20G=C3=B6ppel?= <43101280+alfi0812@users.noreply.github.com> Date: Sun, 6 Jul 2025 21:54:18 +0200 Subject: [PATCH] fix(common): gluetun addon (#37088) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code - [ ] 📜 Documentation Changes **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made changes to the documentation - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning - [ ] I made sure the title starts with `feat(chart-name):`, `fix(chart-name):`, `chore(chart-name):`, `docs(chart-name):` or `fix(docs):` **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Alfred Göppel <43101280+alfi0812@users.noreply.github.com> --- charts/library/common/Chart.yaml | 2 +- .../common/templates/addons/_gluetun.tpl | 20 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/charts/library/common/Chart.yaml b/charts/library/common/Chart.yaml index b0fca84cad9..7e8819cf48b 100644 --- a/charts/library/common/Chart.yaml +++ b/charts/library/common/Chart.yaml @@ -48,4 +48,4 @@ sources: - https://hub.docker.com/_/ - https://hub.docker.com/r/mikefarah/yq type: library -version: 28.12.5 +version: 28.12.6 diff --git a/charts/library/common/templates/addons/_gluetun.tpl b/charts/library/common/templates/addons/_gluetun.tpl index 9bf80a62867..ea0ca301701 100644 --- a/charts/library/common/templates/addons/_gluetun.tpl +++ b/charts/library/common/templates/addons/_gluetun.tpl @@ -11,21 +11,21 @@ It will include / inject the required templates based on the given values. {{- $fw := $glue.container.env.FIREWALL -}} {{- if (eq $fw "on") -}} + {{- $nets := list -}} {{- 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 -}} + {{- $nets = splitList "," $glue.container.env.FIREWALL_OUTBOUND_SUBNETS -}} {{- end -}} + {{- $nets = mustAppend $nets $.Values.chartContext.podCIDR -}} {{- $nets = mustAppend $nets $.Values.chartContext.svcCIDR -}} {{- $nets = mustUniq $nets -}} {{- $_ := set $glue.container.env "FIREWALL_OUTBOUND_SUBNETS" (join "," $nets) -}} - {{- $inputPorts := $glue.container.env.FIREWALL_INPUT_PORTS | splitList "," -}} - {{- if and - $.Values.service $.Values.service.main $.Values.service.main.ports - $.Values.service.main.ports.main $.Values.service.main.ports.main.port - -}} + {{- $inputPorts := list -}} + {{- if hasKey $glue.container.env "FIREWALL_INPUT_PORTS" -}} + {{- $inputPorts = splitList "," $glue.container.env.FIREWALL_INPUT_PORTS -}} + {{- end -}} + {{- if and $.Values.service $.Values.service.main $.Values.service.main.ports $.Values.service.main.ports.main $.Values.service.main.ports.main.port -}} {{- $inputPorts = mustAppend $inputPorts $.Values.service.main.ports.main.port -}} {{- end -}} {{- $inputPorts = $inputPorts | mustUniq -}} @@ -52,9 +52,7 @@ It will include / inject the required templates based on the given values. {{- $_ := set $secValues "enabled" true -}} {{- $_ := set $.Values.secret $secretName $secValues -}} - {{- $persistence := (dict - "enabled" true "type" "secret" "objectName" $secretName "targetSelector" dict "items" list - ) -}} + {{- $persistence := (dict "enabled" true "type" "secret" "objectName" $secretName "targetSelector" dict "items" list ) -}} {{- if $secValues.defaultMode -}} {{- $_ := set $persistence "defaultMode" $secValues.defaultMode -}} {{- end -}}