[bitnami/tomcat] Add existing secret management (#23558)

This commit is contained in:
Matthieu ROBIN
2024-02-19 12:14:49 +01:00
committed by GitHub
parent 1a1f6b784f
commit 4fd3c1f15e
6 changed files with 34 additions and 21 deletions

View File

@@ -47,6 +47,13 @@ Return the proper Docker Image Registry Secret Names
{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.volumePermissions.image .Values.metrics.jmx.image) "global" .Values.global) -}}
{{- end -}}
{{/*
Return the Tomcat credential secret name
*/}}
{{- define "tomcat.secretName" -}}
{{- coalesce .Values.existingSecret (include "common.names.fullname" .) -}}
{{- end -}}
{{/*
Check if there are rolling tags in the images
*/}}

View File

@@ -82,7 +82,7 @@ containers:
- name: TOMCAT_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "common.names.fullname" . }}
name: {{ include "tomcat.secretName" . }}
key: tomcat-password
- name: TOMCAT_ALLOW_REMOTE_MANAGEMENT
value: {{ .Values.tomcatAllowRemoteManagement | quote }}

View File

@@ -3,6 +3,7 @@ Copyright VMware, Inc.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if not .Values.existingSecret }}
apiVersion: v1
kind: Secret
metadata:
@@ -15,3 +16,4 @@ metadata:
type: Opaque
data:
tomcat-password: {{ include "common.secrets.passwords.manage" (dict "secret" (include "common.names.fullname" .) "key" "tomcat-password" "providedValues" (list "tomcatPassword") "length" 10 "strong" false "context" $) }}
{{- end }}