From ae573a8c2f3960b0974401fefb2d2aafcf5dec3a Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Mon, 22 Sep 2025 22:28:23 +0300 Subject: [PATCH] fix(wireguard): chart ipv6 killswitch is misconfigured (#39865) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use the correct helm variable when templating `KILLSWITCH_EXCLUDEDNETWORKS_IPV6` use helm funcs `prepend` and `join` to correctly handle empty input arrays, and template out the right env var string value **Description** ⚒️ Fixes https://github.com/trueforge-org/truecharts/issues/39864 **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [x] 🪛 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 - [x] 👀 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 - [x] ⬆️ I increased versions for any altered app according to semantic versioning - [x] 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> Co-authored-by: Alfred Göppel <43101280+alfi0812@users.noreply.github.com> --- charts/stable/wireguard/Chart.yaml | 3 +-- charts/stable/wireguard/templates/_configmap.tpl | 13 ++++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/charts/stable/wireguard/Chart.yaml b/charts/stable/wireguard/Chart.yaml index 89a11571cf9..53ded84a371 100644 --- a/charts/stable/wireguard/Chart.yaml +++ b/charts/stable/wireguard/Chart.yaml @@ -37,5 +37,4 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/stable/wireguard - https://github.com/trueforge-org/truecharts/tree/master/charts/stable/wireguard type: application -version: 11.6.0 - +version: 11.6.1 diff --git a/charts/stable/wireguard/templates/_configmap.tpl b/charts/stable/wireguard/templates/_configmap.tpl index 0763b8b84b6..c70f0bccd57 100644 --- a/charts/stable/wireguard/templates/_configmap.tpl +++ b/charts/stable/wireguard/templates/_configmap.tpl @@ -6,15 +6,10 @@ data: IPTABLES_BACKEND: nft KILLSWITCH: {{ .Values.wg.killswitch | quote }} {{- if .Values.wg.killswitch }} - {{- $excludedIP4net := "172.16.0.0/12" }} - {{- range .Values.wg.excludedIP4networks }} - {{- $excludedIP4net = ( printf "%v;%v" $excludedIP4net . ) }} - {{- end }} + {{- $excludedIP4Networks := prepend .Values.wg.excludedIP4networks .Values.chartContext.podCIDR }} + {{- $excludedIP4net := (join ";" $excludedIP4Networks) }} KILLSWITCH_EXCLUDEDNETWORKS_IPV4: {{ $excludedIP4net | quote }} - {{- $excludedIP6net := "" }} - {{- range .Values.wg.excludedIP6networks }} - {{- $excludedIP6net = ( printf "%v;%v" $excludedIP6net . ) }} - {{- end }} - KILLSWITCH_EXCLUDEDNETWORKS_IPV6: {{ $excludedIP4net | quote }} + {{- $excludedIP6net := (join ";" .Values.wg.excludedIP6networks) }} + KILLSWITCH_EXCLUDEDNETWORKS_IPV6: {{ $excludedIP6net | quote }} {{- end }} {{- end -}}