diff --git a/stable/drupal/Chart.yaml b/stable/drupal/Chart.yaml index 6d9e63b618..b277014348 100644 --- a/stable/drupal/Chart.yaml +++ b/stable/drupal/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: drupal -version: 5.0.0 +version: 5.1.0 appVersion: 8.7.5 description: One of the most versatile open source content management systems. keywords: diff --git a/stable/drupal/README.md b/stable/drupal/README.md index 72cf411528..d574015c8c 100644 --- a/stable/drupal/README.md +++ b/stable/drupal/README.md @@ -51,6 +51,7 @@ The following table lists the configurable parameters of the Drupal chart and th | --------------------------------- | ------------------------------------------ | --------------------------------------------------------- | | `global.imageRegistry` | Global Docker image registry | `nil` | | `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | +| `global.storageClass` | Global storage class for dynamic provisioning | `nil` | | `image.registry` | Drupal image registry | `docker.io` | | `image.repository` | Drupal Image name | `bitnami/drupal` | | `image.tag` | Drupal Image tag | `{TAG_NAME}` | diff --git a/stable/drupal/templates/_helpers.tpl b/stable/drupal/templates/_helpers.tpl index 3e8ec59b0f..996591feb5 100644 --- a/stable/drupal/templates/_helpers.tpl +++ b/stable/drupal/templates/_helpers.tpl @@ -118,3 +118,23 @@ imagePullSecrets: {{- end }} {{- end -}} {{- end -}} + +{{/* +Return the proper Storage Class +*/}} +{{- define "drupal.storageClass" -}} +{{- $storageClass := "" }} +{{- if .Values.persistence.drupal.storageClass -}} + {{- $storageClass = .Values.persistence.drupal.storageClass -}} +{{- end -}} +{{- if .Values.global -}} + {{- if .Values.global.storageClass -}} + {{- $storageClass = .Values.global.storageClass -}} + {{- end -}} +{{- end -}} +{{- if (eq "-" $storageClass) -}} + {{- printf "\"\"" -}} +{{- else }} + {{- printf "%s" $storageClass -}} +{{- end -}} +{{- end -}} diff --git a/stable/drupal/templates/drupal-pvc.yaml b/stable/drupal/templates/drupal-pvc.yaml index 0f1378ad11..45a9ea544c 100644 --- a/stable/drupal/templates/drupal-pvc.yaml +++ b/stable/drupal/templates/drupal-pvc.yaml @@ -17,11 +17,5 @@ spec: resources: requests: storage: {{ .Values.persistence.drupal.size | quote }} -{{- if and .Values.persistence.drupal.storageClass (not .Values.persistence.drupal.hostPath) -}} -{{- if (eq "-" .Values.persistence.drupal.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: "{{ .Values.persistence.drupal.storageClass }}" -{{- end }} -{{- end }} + storageClassName: {{ include "drupal.storageClass" . }} {{- end -}} diff --git a/stable/drupal/values.yaml b/stable/drupal/values.yaml index bba9390fea..58c52df836 100644 --- a/stable/drupal/values.yaml +++ b/stable/drupal/values.yaml @@ -6,6 +6,7 @@ # imageRegistry: myRegistryName # imagePullSecrets: # - myRegistryKeySecretName +# storageClass: myStorageClass ## Bitnami Drupal image version ## ref: https://hub.docker.com/r/bitnami/drupal/tags/