diff --git a/stable/drupal/Chart.yaml b/stable/drupal/Chart.yaml index b277014348..15a2e82d14 100644 --- a/stable/drupal/Chart.yaml +++ b/stable/drupal/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: drupal -version: 5.1.0 +version: 5.1.1 appVersion: 8.7.5 description: One of the most versatile open source content management systems. keywords: diff --git a/stable/drupal/templates/_helpers.tpl b/stable/drupal/templates/_helpers.tpl index 996591feb5..b8d252bb2d 100644 --- a/stable/drupal/templates/_helpers.tpl +++ b/stable/drupal/templates/_helpers.tpl @@ -123,18 +123,33 @@ imagePullSecrets: Return the proper Storage Class */}} {{- define "drupal.storageClass" -}} -{{- $storageClass := "" }} -{{- if .Values.persistence.drupal.storageClass -}} - {{- $storageClass = .Values.persistence.drupal.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.drupal.storageClass -}} + {{- if (eq "-" .Values.persistence.drupal.storageClass) -}} + {{- printf "\"\"" -}} + {{- else }} + {{- printf "%s" .Values.persistence.drupal.storageClass -}} + {{- end -}} + {{- end -}} + {{- end -}} +{{- else -}} + {{- if .Values.persistence.drupal.storageClass -}} + {{- if (eq "-" .Values.persistence.drupal.storageClass) -}} + {{- printf "\"\"" -}} + {{- else }} + {{- printf "%s" .Values.persistence.drupal.storageClass -}} + {{- end -}} {{- end -}} {{- end -}} -{{- if (eq "-" $storageClass) -}} - {{- printf "\"\"" -}} -{{- else }} - {{- printf "%s" $storageClass -}} -{{- end -}} {{- end -}}