From 131b7e7c5a2080eaddf02b8e1f15e242f034394e Mon Sep 17 00:00:00 2001 From: Vadim Stepanov Date: Tue, 8 Nov 2022 12:00:42 +0000 Subject: [PATCH] helm: allow empty smtp password, bump chart version (#797) * helm: allow empty smtp password * don't create the secret in case it's empty * helm: set EMAIL_USE_TLS to true by default --- helm/oncall/Chart.yaml | 2 +- helm/oncall/templates/_env.tpl | 3 ++- helm/oncall/templates/secrets.yaml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/helm/oncall/Chart.yaml b/helm/oncall/Chart.yaml index 79159074..1c9b491b 100644 --- a/helm/oncall/Chart.yaml +++ b/helm/oncall/Chart.yaml @@ -8,7 +8,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.10 +version: 1.0.11 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/helm/oncall/templates/_env.tpl b/helm/oncall/templates/_env.tpl index cdff2fd8..1620523a 100644 --- a/helm/oncall/templates/_env.tpl +++ b/helm/oncall/templates/_env.tpl @@ -364,8 +364,9 @@ rabbitmq-password secretKeyRef: name: {{ include "oncall.fullname" . }}-smtp key: smtp-password + optional: true - name: EMAIL_USE_TLS - value: {{ .Values.oncall.smtp.tls | toString | title | quote }} + value: {{ .Values.oncall.smtp.tls | default true | toString | title | quote }} - name: EMAIL_FROM_ADDRESS value: {{ .Values.oncall.smtp.fromEmail | quote }} {{- else -}} diff --git a/helm/oncall/templates/secrets.yaml b/helm/oncall/templates/secrets.yaml index dfd7cdb2..07fa1351 100644 --- a/helm/oncall/templates/secrets.yaml +++ b/helm/oncall/templates/secrets.yaml @@ -41,14 +41,14 @@ data: redis-password: {{ required "externalRedis.password is required if not redis.enabled" .Values.externalRedis.password | b64enc | quote }} {{- end }} --- -{{ if .Values.oncall.smtp.enabled -}} +{{ if and .Values.oncall.smtp.enabled .Values.oncall.smtp.password -}} apiVersion: v1 kind: Secret metadata: name: {{ include "oncall.fullname" . }}-smtp type: Opaque data: - smtp-password: {{ required "oncall.smtp.password is required if oncall.smtp.enabled" .Values.oncall.smtp.password | b64enc | quote }} + smtp-password: {{ .Values.oncall.smtp.password | b64enc | quote }} {{- end }} --- {{ if and (not .Values.postgresql.enabled) (eq .Values.database.type "postgresql") (not .Values.externalPostgresql.existingSecret) -}}