[bitnami/tomcat] Allow setting existing PVCs (#2130)

Signed-off-by: Javier J. Salmeron Garcia <jsalmeron@vmware.com>

Co-authored-by: Carlos Rodríguez Hernández <carlosrh@vmware.com>
This commit is contained in:
Javier J. Salmerón-García
2020-03-26 12:21:54 +01:00
committed by GitHub
parent 8041743dc9
commit a4573d871f
5 changed files with 13 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
apiVersion: v1
name: tomcat
version: 6.2.10
version: 6.3.0
appVersion: 9.0.33
description: Chart for Apache Tomcat
keywords:

View File

@@ -30,6 +30,13 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Expand the name of the chart.
*/}}
{{- define "tomcat.pvc" -}}
{{- coalesce .Values.persistence.existingClaim (include "tomcat.fullname" .) -}}
{{- end -}}
{{/*
Common labels
*/}}

View File

@@ -93,7 +93,7 @@ spec:
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "tomcat.fullname" . }}
claimName: {{ template "tomcat.pvc" . }}
{{- else }}
emptyDir: {}
{{- end -}}

View File

@@ -1,4 +1,4 @@
{{- if .Values.persistence.enabled -}}
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:

View File

@@ -159,6 +159,9 @@ persistence:
## Persistent Volume size
##
size: 8Gi
## Name of an existing PVC
##
existingClaim:
## Service parameters
##