From dc2a2677f4a8924ef6bd3ab7732e5e59ab72fc4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Cabrera=20Mi=C3=B1agorri?= Date: Tue, 20 Aug 2019 12:49:59 +0200 Subject: [PATCH] [stable/phabricator] Add global StorageClass to phabricator (#16429) Signed-off-by: Miguel A. Cabrera Minagorri --- stable/phabricator/Chart.yaml | 2 +- stable/phabricator/README.md | 1 + stable/phabricator/templates/_helpers.tpl | 20 +++++++++++++++++++ .../templates/phabricator-pvc.yaml | 8 +------- stable/phabricator/values.yaml | 1 + 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/stable/phabricator/Chart.yaml b/stable/phabricator/Chart.yaml index 9dae633856..2bf0a5c1c3 100644 --- a/stable/phabricator/Chart.yaml +++ b/stable/phabricator/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: phabricator -version: 6.2.2 +version: 6.3.0 appVersion: 2019.32.0 description: Collection of open source web applications that help software companies build better software. keywords: diff --git a/stable/phabricator/README.md b/stable/phabricator/README.md index fa8d07381a..6c79ec52ef 100644 --- a/stable/phabricator/README.md +++ b/stable/phabricator/README.md @@ -51,6 +51,7 @@ The following table lists the configurable parameters of the Phabricator chart a |----------------------------------------|--------------------------------------------------|----------------------------------------------------------| | `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` | Phabricator image registry | `docker.io` | | `image.repository` | Phabricator image name | `bitnami/phabricator` | | `image.tag` | Phabricator image tag | `{TAG_NAME}` | diff --git a/stable/phabricator/templates/_helpers.tpl b/stable/phabricator/templates/_helpers.tpl index 8e0b99222c..80bdcd87a4 100644 --- a/stable/phabricator/templates/_helpers.tpl +++ b/stable/phabricator/templates/_helpers.tpl @@ -132,3 +132,23 @@ imagePullSecrets: {{- end }} {{- end -}} {{- end -}} + +{{/* +Return the proper Storage Class +*/}} +{{- define "phabricator.storageClass" -}} +{{- $storageClass := "" }} +{{- if .Values.persistence.phabricator.storageClass -}} + {{- $storageClass = .Values.persistence.phabricator.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/phabricator/templates/phabricator-pvc.yaml b/stable/phabricator/templates/phabricator-pvc.yaml index 43fa8a116c..6e926e9597 100644 --- a/stable/phabricator/templates/phabricator-pvc.yaml +++ b/stable/phabricator/templates/phabricator-pvc.yaml @@ -14,11 +14,5 @@ spec: resources: requests: storage: {{ .Values.persistence.phabricator.size | quote }} -{{- if .Values.persistence.phabricator.storageClass }} -{{- if (eq "-" .Values.persistence.phabricator.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: "{{ .Values.persistence.phabricator.storageClass }}" -{{- end }} -{{- end }} + storageClassName: {{ include "phabricator.storageClass" . }} {{- end -}} diff --git a/stable/phabricator/values.yaml b/stable/phabricator/values.yaml index 3138f84913..7c0262f3a8 100644 --- a/stable/phabricator/values.yaml +++ b/stable/phabricator/values.yaml @@ -6,6 +6,7 @@ # imageRegistry: myRegistryName # imagePullSecrets: # - myRegistryKeySecretName +# storageClass: myStorageClass ## Bitnami Phabricator image version ## ref: https://hub.docker.com/r/bitnami/phabricator/tags/