diff --git a/stable/odoo/Chart.yaml b/stable/odoo/Chart.yaml index f443b91966..fced651678 100644 --- a/stable/odoo/Chart.yaml +++ b/stable/odoo/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: odoo -version: 10.0.3 +version: 10.1.0 appVersion: 12.0.20190815 description: A suite of web based open source business apps. home: https://www.odoo.com/ diff --git a/stable/odoo/README.md b/stable/odoo/README.md index 243c849777..02914a5658 100644 --- a/stable/odoo/README.md +++ b/stable/odoo/README.md @@ -51,6 +51,7 @@ The following table lists the configurable parameters of the Odoo chart and thei |---------------------------------------|-----------------------------------------------------------|---------------------------------------------------------| | `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` | Odoo image registry | `docker.io` | | `image.repository` | Odoo Image name | `bitnami/odoo` | | `image.tag` | Odoo Image tag | `{TAG_NAME}` | diff --git a/stable/odoo/templates/_helpers.tpl b/stable/odoo/templates/_helpers.tpl index a2b9c2bf5a..547e6e9b42 100644 --- a/stable/odoo/templates/_helpers.tpl +++ b/stable/odoo/templates/_helpers.tpl @@ -89,3 +89,23 @@ imagePullSecrets: {{- end }} {{- end -}} {{- end -}} + +{{/* +Return the proper Storage Class +*/}} +{{- define "odoo.storageClass" -}} +{{- $storageClass := "" }} +{{- if .Values.persistence.storageClass -}} + {{- $storageClass = .Values.persistence.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/odoo/templates/pvc.yaml b/stable/odoo/templates/pvc.yaml index 58e3b479ed..d422f5e6e8 100644 --- a/stable/odoo/templates/pvc.yaml +++ b/stable/odoo/templates/pvc.yaml @@ -14,11 +14,5 @@ spec: resources: requests: storage: {{ .Values.persistence.size | quote }} -{{- if .Values.persistence.storageClass }} -{{- if (eq "-" .Values.persistence.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: {{ .Values.persistence.storageClass | quote }} -{{- end }} -{{- end }} + storageClassName: {{ include "odoo.storageClass" . }} {{- end -}} diff --git a/stable/odoo/values.yaml b/stable/odoo/values.yaml index 37c284be54..7962ad5b47 100644 --- a/stable/odoo/values.yaml +++ b/stable/odoo/values.yaml @@ -6,6 +6,7 @@ # imageRegistry: myRegistryName # imagePullSecrets: # - myRegistryKeySecretName +# storageClass: myStorageClass ## Bitnami Odoo image version ## ref: https://hub.docker.com/r/bitnami/odoo/tags/