From 5a92ff92c9e938fde542a081440676f150063806 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Sun, 19 May 2024 02:05:30 +0300 Subject: [PATCH] fix(clusterissuer): fix var scope (#22216) 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 **🧪 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 corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 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):` or `chore(chart-name):` **➕ 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._ --- charts/premium/clusterissuer/Chart.yaml | 2 +- .../templates/clusterissuer/_ACME.tpl | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/charts/premium/clusterissuer/Chart.yaml b/charts/premium/clusterissuer/Chart.yaml index be698b4bd69..09c9e5d6252 100644 --- a/charts/premium/clusterissuer/Chart.yaml +++ b/charts/premium/clusterissuer/Chart.yaml @@ -34,4 +34,4 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/premium/clusterissuer - https://hub.docker.com/_/hello-world type: application -version: 8.0.7 +version: 8.0.8 diff --git a/charts/premium/clusterissuer/templates/clusterissuer/_ACME.tpl b/charts/premium/clusterissuer/templates/clusterissuer/_ACME.tpl index e49a071c590..82db307cb09 100644 --- a/charts/premium/clusterissuer/templates/clusterissuer/_ACME.tpl +++ b/charts/premium/clusterissuer/templates/clusterissuer/_ACME.tpl @@ -2,15 +2,15 @@ {{- $operator := index $.Values.operator "cert-manager" -}} {{- $namespace := $operator.namespace | default "cert-manager" -}} -{{- $rfctsigSecret := .rfctsigSecret | default "" -}} -{{/* https://cert-manager.io/docs/configuration/acme/dns01/rfc2136/#troubleshooting */}} -{{- if $rfctsigSecret -}} {{/* If we try to decode and fail, go on and encode it. */}} - {{- if (contains "illegal base64" (b64dec $rfctsigSecret)) -}} - {{- $rfctsigSecret = b64enc $rfctsigSecret -}} - {{- end -}} -{{- end -}} - {{- range .Values.clusterIssuer.ACME }} + {{- $rfctsigSecret := .rfctsigSecret | default "" -}} + {{/* https://cert-manager.io/docs/configuration/acme/dns01/rfc2136/#troubleshooting */}} + {{- if $rfctsigSecret -}} {{/* If we try to decode and fail, go on and encode it. */}} + {{- if (contains "illegal base64" (b64dec $rfctsigSecret)) -}} + {{- $rfctsigSecret = b64enc $rfctsigSecret -}} + {{- end -}} + {{- end -}} + {{- if or (not .name) (not (mustRegexMatch "^[a-z]+(-?[a-z]){0,63}-?[a-z]+$" .name)) -}} {{- fail "ACME - Expected name to be all lowercase with hyphens, but not start or end with a hyphen" -}} {{- end -}} @@ -18,13 +18,13 @@ {{- if not (mustHas .type $validTypes) -}} {{- fail (printf "Expected ACME type to be one of [%s], but got [%s]" (join ", " $validTypes) .type) -}} {{- end -}} - {{- $issuerSecretName := printf "%s-clusterissuer-secret" .name }} + {{- $issuerSecretName := printf "%s-clusterissuer-secret" .name -}} {{- $acmednsDict := dict -}} {{- if and (eq .type "acmedns") (not .acmednsConfigJson) }} - {{- range .acmednsConfig }} + {{- range .acmednsConfig -}} {{/* Transform to a dict with domain as a key, also remove domain from the dict */}} {{- $_ := set $acmednsDict .domain (omit . "domain") -}} - {{- end }} + {{- end -}} {{- end }} --- apiVersion: cert-manager.io/v1