github.com/zsuzhengdu/helm@v3.0.0-beta.3+incompatible/cmd/helm/testdata/testcharts/lib-chart/templates/_persistentvolumeclaim.yaml (about) 1 {{- define "common.persistentvolumeclaim.tpl" -}} 2 apiVersion: v1 3 kind: PersistentVolumeClaim 4 {{ template "common.metadata" . }} 5 spec: 6 accessModes: 7 - {{ .Values.persistence.accessMode | quote }} 8 resources: 9 requests: 10 storage: {{ .Values.persistence.size | quote }} 11 {{- if .Values.persistence.storageClass }} 12 {{- if (eq "-" .Values.persistence.storageClass) }} 13 storageClassName: "" 14 {{- else }} 15 storageClassName: "{{ .Values.persistence.storageClass }}" 16 {{- end }} 17 {{- end }} 18 {{- end -}} 19 {{- define "common.persistentvolumeclaim" -}} 20 {{- $top := first . -}} 21 {{- if and $top.Values.persistence.enabled (not $top.Values.persistence.existingClaim) -}} 22 {{- template "common.util.merge" (append . "common.persistentvolumeclaim.tpl") -}} 23 {{- end -}} 24 {{- end -}}