From 974e8de479a7506849e22b8c45df5d1ed266e16e Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sat, 28 Dec 2024 15:41:27 +0000 Subject: [PATCH 1/4] [Ghost] Correctly handle smtpExistingSecret value Signed-off-by: Marcus Noble --- bitnami/ghost/Chart.yaml | 2 +- bitnami/ghost/templates/_helpers.tpl | 11 +++++++++++ bitnami/ghost/templates/deployment.yaml | 6 ++---- bitnami/ghost/templates/secrets.yaml | 20 +++++++++++++++++--- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/bitnami/ghost/Chart.yaml b/bitnami/ghost/Chart.yaml index 9dffdfd37c4fd5..3ef021a754c870 100644 --- a/bitnami/ghost/Chart.yaml +++ b/bitnami/ghost/Chart.yaml @@ -40,4 +40,4 @@ maintainers: name: ghost sources: - https://github.com/bitnami/charts/tree/main/bitnami/ghost -version: 22.1.2 +version: 22.1.3 diff --git a/bitnami/ghost/templates/_helpers.tpl b/bitnami/ghost/templates/_helpers.tpl index 4f64bf2f6c9ec9..42e0e8a28d5088 100644 --- a/bitnami/ghost/templates/_helpers.tpl +++ b/bitnami/ghost/templates/_helpers.tpl @@ -136,6 +136,17 @@ Return the MySQL Secret Name {{- end -}} {{- end -}} +{{/* +Return the SMTP Secret Name +*/}} +{{- define "ghost.smtpSecretName" -}} +{{- if .Values.smtpExistingSecret }} + {{- printf "%s" .Values.smtpExistingSecret -}} +{{- else -}} + {{- printf "%s-smtp" (include "common.names.fullname" .) -}} +{{- end -}} +{{- end -}} + {{/* Compile all warnings into a single message. */}} diff --git a/bitnami/ghost/templates/deployment.yaml b/bitnami/ghost/templates/deployment.yaml index 7cd5ec58435f57..fa3c1379f5d8d7 100644 --- a/bitnami/ghost/templates/deployment.yaml +++ b/bitnami/ghost/templates/deployment.yaml @@ -204,13 +204,11 @@ spec: - name: GHOST_SMTP_USER value: {{ .Values.smtpUser | quote }} {{- end }} - {{- if .Values.smtpPassword }} - name: GHOST_SMTP_PASSWORD valueFrom: secretKeyRef: - name: {{ include "common.secrets.name" (dict "existingSecret" .Values.existingSecret "context" $) }} - key: {{ include "common.secrets.key" (dict "existingSecret" .Values.existingSecret "key" "smtp-password") }} - {{- end }} + name: {{ include "ghost.smtpSecretName" . }} + key: smtp-password {{- if .Values.smtpService }} - name: GHOST_SMTP_SERVICE value: {{ .Values.smtpService | quote }} diff --git a/bitnami/ghost/templates/secrets.yaml b/bitnami/ghost/templates/secrets.yaml index 7cfd87f1a87ae8..e55b185927815f 100644 --- a/bitnami/ghost/templates/secrets.yaml +++ b/bitnami/ghost/templates/secrets.yaml @@ -3,7 +3,7 @@ Copyright Broadcom, Inc. All Rights Reserved. SPDX-License-Identifier: APACHE-2.0 */}} -{{- if or (not .Values.existingSecret) (and (not .Values.smtpExistingSecret) .Values.smtpPassword) }} +{{- if not .Values.existingSecret }} apiVersion: v1 kind: Secret metadata: @@ -22,9 +22,23 @@ data: ghost-password: {{ randAlphaNum 10 | b64enc | quote }} {{- end }} {{- end }} - {{- if and .Values.smtpPassword (not .Values.smtpExistingSecret) }} +--- +{{- end }} + +{{- if not .Values.smtpExistingSecret }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "common.names.fullname" . }}-smtp + namespace: {{ .Release.Namespace | quote }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +type: Opaque +data: {{- if .Values.smtpPassword }} smtp-password: {{ .Values.smtpPassword | b64enc | quote }} {{- end }} - {{- end }} +--- {{- end }} From 9687fcc60939f13c37928402a62102e4f87f20a5 Mon Sep 17 00:00:00 2001 From: Bitnami Containers Date: Sat, 28 Dec 2024 15:50:48 +0000 Subject: [PATCH 2/4] Update CHANGELOG.md Signed-off-by: Bitnami Containers --- bitnami/ghost/CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bitnami/ghost/CHANGELOG.md b/bitnami/ghost/CHANGELOG.md index 2454a10f3ca208..ae58da976ccb29 100644 --- a/bitnami/ghost/CHANGELOG.md +++ b/bitnami/ghost/CHANGELOG.md @@ -1,8 +1,12 @@ # Changelog -## 22.1.2 (2024-12-13) +## 22.1.3 (2024-12-28) -* [bitnami/ghost] Release 22.1.2 ([#31038](https://github.com/bitnami/charts/pull/31038)) +* [bitnami/Ghost] Correctly handle smtpExistingSecret value ([#31179](https://github.com/bitnami/charts/pull/31179)) + +## 22.1.2 (2024-12-13) + +* [bitnami/ghost] Release 22.1.2 (#31038) ([b5d4c51](https://github.com/bitnami/charts/commit/b5d4c5136f4da9c15b23fa036fc2f826f3852adf)), closes [#31038](https://github.com/bitnami/charts/issues/31038) ## 22.1.1 (2024-12-11) From bfc8f4736551d5459fdada5c664dfbcf6e16b84b Mon Sep 17 00:00:00 2001 From: Bitnami Containers Date: Sun, 29 Dec 2024 00:15:15 +0000 Subject: [PATCH 3/4] Update CHANGELOG.md Signed-off-by: Bitnami Containers --- bitnami/ghost/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitnami/ghost/CHANGELOG.md b/bitnami/ghost/CHANGELOG.md index ae58da976ccb29..a72fcfb90d0d8e 100644 --- a/bitnami/ghost/CHANGELOG.md +++ b/bitnami/ghost/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 22.1.3 (2024-12-28) +## 22.1.3 (2024-12-29) * [bitnami/Ghost] Correctly handle smtpExistingSecret value ([#31179](https://github.com/bitnami/charts/pull/31179)) From cdaa298690731922c005c29bba295ff4776f3582 Mon Sep 17 00:00:00 2001 From: Bitnami Containers Date: Tue, 7 Jan 2025 16:51:24 +0000 Subject: [PATCH 4/4] Update CHANGELOG.md Signed-off-by: Bitnami Containers --- bitnami/ghost/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitnami/ghost/CHANGELOG.md b/bitnami/ghost/CHANGELOG.md index a72fcfb90d0d8e..e9438bed7b25ce 100644 --- a/bitnami/ghost/CHANGELOG.md +++ b/bitnami/ghost/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 22.1.3 (2024-12-29) +## 22.1.3 (2025-01-07) * [bitnami/Ghost] Correctly handle smtpExistingSecret value ([#31179](https://github.com/bitnami/charts/pull/31179))