From e69624556c5772e9f8b79a43897163374be5f785 Mon Sep 17 00:00:00 2001 From: Tim Balzer Date: Thu, 8 Aug 2024 15:11:27 +0200 Subject: [PATCH] Refactor cassandra.truststoreSecretName helper Co-authored-by: Miguel Ruiz Signed-off-by: Tim Balzer --- bitnami/cassandra/templates/_helpers.tpl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bitnami/cassandra/templates/_helpers.tpl b/bitnami/cassandra/templates/_helpers.tpl index 589cee97d86e40..b7ac6403062822 100644 --- a/bitnami/cassandra/templates/_helpers.tpl +++ b/bitnami/cassandra/templates/_helpers.tpl @@ -230,15 +230,13 @@ Return the Cassandra TLS keystore secret {{- end -}} {{- end -}} {{/* - -Return the Cassandra TLS truststore secret +Return the Cassandra TLS truststore secret. If not provided we assume the trustore is stored in the keystore secret. */}} {{- define "cassandra.truststoreSecretName" -}} -{{- $secretName := coalesce .Values.tls.existingTrustSecret .Values.tls.existingSecret .Values.tls.tlsEncryptionSecretName -}} -{{- if $secretName -}} - {{- printf "%s" (tpl $secretName $) -}} +{{- if .Values.tls.existingTrustSecret -}} + {{- print (tpl .Values.tls.existingTrustSecret $) -}} {{- else -}} - {{- printf "%s-crt" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}} + {{- print (include "cassandra.keystoreSecretName" .) -}} {{- end -}} {{- end -}}