From b545e2eb02dfd25bd2efc68ce4403788b55ab1d0 Mon Sep 17 00:00:00 2001 From: Mikhail Terentev Date: Tue, 18 Jul 2023 18:56:21 +0300 Subject: [PATCH] Allow setting SMTP credentials via ExternalSecret --- charts/allure-testops/templates/allure/uaa-dep.yaml | 10 ++++++++-- charts/allure-testops/templates/infra/secret.yaml | 4 ++++ charts/allure-testops/values.yaml | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/charts/allure-testops/templates/allure/uaa-dep.yaml b/charts/allure-testops/templates/allure/uaa-dep.yaml index ece66eb..be6292c 100644 --- a/charts/allure-testops/templates/allure/uaa-dep.yaml +++ b/charts/allure-testops/templates/allure/uaa-dep.yaml @@ -199,11 +199,17 @@ spec: - name: SPRING_MAIL_PORT value: "{{ .Values.smtp.port }}" - name: SPRING_MAIL_USERNAME - value: {{ .Values.smtp.username }} + valueFrom: + secretKeyRef: + name: {{ $secret_name }} + key: "smtpUsername" - name: ALLURE_MAIL_FROM value: {{ .Values.smtp.from }} - name: SPRING_MAIL_PASSWORD - value: {{ .Values.smtp.password }} + valueFrom: + secretKeyRef: + name: {{ $secret_name }} + key: "smtpPassword" - name: SPRING_MAIL_PROPERTIES_MAIL_SMTP_AUTH value: {{ .Values.smtp.authEnabled | quote }} - name: SPRING_MAIL_PROPERTIES_MAIL_SMTP_STARTTLS_ENABLE diff --git a/charts/allure-testops/templates/infra/secret.yaml b/charts/allure-testops/templates/infra/secret.yaml index 19bbc5a..f4be14d 100644 --- a/charts/allure-testops/templates/infra/secret.yaml +++ b/charts/allure-testops/templates/infra/secret.yaml @@ -62,4 +62,8 @@ data: {{- if .Values.licenseApiToken }} licenceApiToken: {{ .Values.licenseApiToken | b64enc | quote }} {{- end }} +{{- if .Values.smtp.enabled }} + smtpUsername: {{ .Values.smtp.username | b64enc | quote }} + smtpPassword: {{ .Values.smtp.password | b64enc | quote }} +{{- end }} {{- end }} diff --git a/charts/allure-testops/values.yaml b/charts/allure-testops/values.yaml index 19b5a80..fef2599 100644 --- a/charts/allure-testops/values.yaml +++ b/charts/allure-testops/values.yaml @@ -276,6 +276,7 @@ smtp: port: 465 authEnabled: true from: noreply@example.com + # Username and password may be set via ExternalSecret as well username: sa-testops-smtp password: SuperSecret # https://en.wikipedia.org/wiki/Opportunistic_TLS