mirror of
https://github.com/helm/charts.git
synced 2026-08-19 20:37:05 +00:00
[stable/osclass] Refactor StorageClass template to support old Helm versions (#16488)
Signed-off-by: miguelaeh <macabrera@bitnami.com>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
4dbcd31556
commit
4aabebe29f
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
name: osclass
|
||||
version: 6.1.0
|
||||
version: 6.1.1
|
||||
appVersion: 3.7.4
|
||||
description: Osclass is a php script that allows you to quickly create and manage
|
||||
your own free classifieds site.
|
||||
|
||||
@@ -145,18 +145,33 @@ imagePullSecrets:
|
||||
Return the proper Storage Class
|
||||
*/}}
|
||||
{{- define "osclass.storageClass" -}}
|
||||
{{- $storageClass := "" }}
|
||||
{{- if .Values.persistence.osclass.storageClass -}}
|
||||
{{- $storageClass = .Values.persistence.osclass.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.osclass.torageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.osclass.torageClass) -}}
|
||||
{{- printf "\"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "%s" .Values.persistence.osclass.torageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.osclass.torageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.osclass.torageClass) -}}
|
||||
{{- printf "\"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "%s" .Values.persistence.osclass.torageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if (eq "-" $storageClass) -}}
|
||||
{{- printf "\"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "%s" $storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user