From 2c94e4fe0e7b37341fd5ab9e36173072e44907ad Mon Sep 17 00:00:00 2001 From: mrskul <51621656+mrskul@users.noreply.github.com> Date: Wed, 28 May 2025 15:43:27 +1000 Subject: [PATCH] update Readme and set cert name as ${mail.fullname} --- README.md | 4 +++- helm/mail/templates/_helpers.tpl | 2 +- helm/test_16_test_existing_certs.yml | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 helm/test_16_test_existing_certs.yml diff --git a/README.md b/README.md index 0ffba67..afadcba 100644 --- a/README.md +++ b/README.md @@ -639,7 +639,9 @@ Chart configuration is as follows: | `nodeSelector` | `{}` | Standard Kubernetes stuff | | `tolerations` | `[]` | Standard Kubernetes stuff | | `affinity` | `{}` | Standard Kubernetes stuff | -| `certs.create` | `{}` | Auto generate TLS certificates for Postfix | +| `certs.create` | `false` | Auto generate TLS certificates for Postfix | +| `certs.existing` | `false` | Use existing TLS certificates for Postfix | +| `certs.existingSecret` | `""` | Existing secret containing the TLS certificates for Postfix | | `extraVolumes` | `[]` | Append any extra volumes to the pod | | `extraVolumeMounts` | `[]` | Append any extra volume mounts to the postfix container | | `extraInitContainers` | `[]` | Execute any extra init containers on startup | diff --git a/helm/mail/templates/_helpers.tpl b/helm/mail/templates/_helpers.tpl index 1eef90a..8ec6fdb 100644 --- a/helm/mail/templates/_helpers.tpl +++ b/helm/mail/templates/_helpers.tpl @@ -84,6 +84,6 @@ Return the secret containing HTTPS/TLS certificates {{- if $secretName -}} {{- printf "%s" (tpl $secretName .) -}} {{- else -}} - {{- printf "smtp-relay-mail-certs" -}} + {{- printf "%s-certs" (include "mail.fullname" .) -}} {{- end -}} {{- end -}} diff --git a/helm/test_16_test_existing_certs.yml b/helm/test_16_test_existing_certs.yml new file mode 100644 index 0000000..844fd8b --- /dev/null +++ b/helm/test_16_test_existing_certs.yml @@ -0,0 +1,3 @@ +certs: + existing: true + existingSecret: "example-tls" \ No newline at end of file