From c0a4069d53745e2b686fde637125b7c7dd8aa2a1 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Sat, 3 Jun 2023 16:12:52 +0300 Subject: [PATCH] Fix db password retrievals. (#452) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes # Since we have `exapendObjectName: false` we need to lookup in the same name as the secret is created and not the exapanded name **⚙️ 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 **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ 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._ --- library/common/Chart.yaml | 2 +- .../common/templates/lib/dependencies/_clickhouseInjector.tpl | 3 +-- library/common/templates/lib/dependencies/_mariadbInjector.tpl | 3 +-- library/common/templates/lib/dependencies/_mongodbInjector.tpl | 3 +-- library/common/templates/lib/dependencies/_redisInjector.tpl | 3 +-- library/common/templates/lib/dependencies/_solrInjector.tpl | 3 +-- 6 files changed, 6 insertions(+), 11 deletions(-) diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index 38eecc05..689733ac 100644 --- a/library/common/Chart.yaml +++ b/library/common/Chart.yaml @@ -15,4 +15,4 @@ maintainers: name: common sources: null type: library -version: 12.12.0 +version: 12.12.1 diff --git a/library/common/templates/lib/dependencies/_clickhouseInjector.tpl b/library/common/templates/lib/dependencies/_clickhouseInjector.tpl index 43d4753d..6a4c0b08 100644 --- a/library/common/templates/lib/dependencies/_clickhouseInjector.tpl +++ b/library/common/templates/lib/dependencies/_clickhouseInjector.tpl @@ -5,8 +5,7 @@ {{- if .Values.clickhouse.enabled -}} {{/* Initialize variables */}} - {{- $basename := include "tc.v1.common.lib.chart.names.fullname" $ -}} - {{- $fetchname := printf "%s-clickhousecreds" $basename -}} + {{- $fetchname := printf "%s-clickhousecreds" .Release.Name -}} {{- $dbprevious := lookup "v1" "Secret" .Release.Namespace $fetchname -}} {{- $dbpreviousold := lookup "v1" "Secret" .Release.Namespace "clickhousecreds" -}} {{- $dbPass := randAlphaNum 50 -}} diff --git a/library/common/templates/lib/dependencies/_mariadbInjector.tpl b/library/common/templates/lib/dependencies/_mariadbInjector.tpl index 6fdc1d55..59565f75 100644 --- a/library/common/templates/lib/dependencies/_mariadbInjector.tpl +++ b/library/common/templates/lib/dependencies/_mariadbInjector.tpl @@ -5,8 +5,7 @@ This template generates a random password and ensures it persists across updates {{- if .Values.mariadb.enabled -}} {{/* Initialize variables */}} - {{- $basename := include "tc.v1.common.lib.chart.names.fullname" $ -}} - {{- $fetchname := printf "%s-mariadbcreds" $basename -}} + {{- $fetchname := printf "%s-mariadbcreds" .Release.Name -}} {{- $dbprevious := lookup "v1" "Secret" .Release.Namespace $fetchname -}} {{- $dbpreviousold := lookup "v1" "Secret" .Release.Namespace "mariadbcreds" -}} {{- $dbPass := randAlphaNum 50 -}} diff --git a/library/common/templates/lib/dependencies/_mongodbInjector.tpl b/library/common/templates/lib/dependencies/_mongodbInjector.tpl index fd06d0dc..12f0ff67 100644 --- a/library/common/templates/lib/dependencies/_mongodbInjector.tpl +++ b/library/common/templates/lib/dependencies/_mongodbInjector.tpl @@ -5,8 +5,7 @@ This template generates a random password and ensures it persists across updates {{- if .Values.mongodb.enabled -}} {{/* Initialize variables */}} - {{- $basename := include "tc.v1.common.lib.chart.names.fullname" $ -}} - {{- $fetchname := printf "%s-mongodbcreds" $basename -}} + {{- $fetchname := printf "%s-mongodbcreds" .Release.Name -}} {{- $dbprevious := lookup "v1" "Secret" .Release.Namespace $fetchname -}} {{- $dbpreviousold := lookup "v1" "Secret" .Release.Namespace "mongodbcreds" -}} {{- $dbPass := randAlphaNum 50 -}} diff --git a/library/common/templates/lib/dependencies/_redisInjector.tpl b/library/common/templates/lib/dependencies/_redisInjector.tpl index 14ff2bc0..68601649 100644 --- a/library/common/templates/lib/dependencies/_redisInjector.tpl +++ b/library/common/templates/lib/dependencies/_redisInjector.tpl @@ -5,8 +5,7 @@ This template generates a random password and ensures it persists across updates {{- if .Values.redis.enabled -}} {{/* Initialize variables */}} - {{- $basename := include "tc.v1.common.lib.chart.names.fullname" $ -}} - {{- $fetchname := printf "%s-rediscreds" $basename -}} + {{- $fetchname := printf "%s-rediscreds" .Release.Name -}} {{- $dbprevious := lookup "v1" "Secret" .Release.Namespace $fetchname -}} {{- $dbPass := randAlphaNum 50 -}} {{- $dbIndex := .Values.redis.redisDatabase | default "0" -}} diff --git a/library/common/templates/lib/dependencies/_solrInjector.tpl b/library/common/templates/lib/dependencies/_solrInjector.tpl index 5df96e00..32d33f21 100644 --- a/library/common/templates/lib/dependencies/_solrInjector.tpl +++ b/library/common/templates/lib/dependencies/_solrInjector.tpl @@ -5,8 +5,7 @@ This template generates a random password and ensures it persists across updates {{- if .Values.solr.enabled -}} {{/* Initialize variables */}} - {{- $basename := include "tc.v1.common.lib.chart.names.fullname" $ -}} - {{- $fetchname := printf "%s-solrcreds" $basename -}} + {{- $fetchname := printf "%s-solrcreds" .Release.Name -}} {{- $solrprevious := lookup "v1" "Secret" .Release.Namespace $fetchname -}} {{- $solrpreviousold := lookup "v1" "Secret" .Release.Namespace "solrcreds" -}} {{- $solrPass := randAlphaNum 50 -}}