mirror of
https://github.com/bitnami/charts.git
synced 2026-03-16 06:47:30 +08:00
Refactor StorageClass template to support old Helm versions
Signed-off-by: miguelaeh <macabrera@bitnami.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
name: wildfly
|
||||
version: 3.2.0
|
||||
version: 3.2.1
|
||||
appVersion: 17.0.1
|
||||
description: Chart for Wildfly
|
||||
keywords:
|
||||
|
||||
@@ -108,18 +108,33 @@ Also, we can't use a single if because lazy evaluation is not an option
|
||||
Return the proper Storage Class
|
||||
*/}}
|
||||
{{- define "wildfly.storageClass" -}}
|
||||
{{- $storageClass := "" }}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- $storageClass = .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
*/}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.storageClass -}}
|
||||
{{- $storageClass = .Values.global.storageClass -}}
|
||||
{{- if (eq "-" .Values.global.storageClass) -}}
|
||||
{{- printf "\"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "%s" .Values.global.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "\"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "%s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "\"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "%s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if (eq "-" $storageClass) -}}
|
||||
{{- printf "\"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "%s" $storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user