[stable/opencart] Add global StorageClass to opencart (#16415)

Signed-off-by: Miguel A. Cabrera Minagorri <macabrera@bitnami.com>
This commit is contained in:
Miguel Ángel Cabrera Miñagorri
2019-08-20 05:05:58 -07:00
committed by Kubernetes Prow Robot
parent 18184d6e88
commit f6d42a3aca
5 changed files with 25 additions and 8 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: opencart
version: 6.0.2
version: 6.1.0
appVersion: 3.0.3-2
description: A free and open source e-commerce platform for online merchants. It provides a professional and reliable foundation for a successful online store.
keywords:
+1
View File
@@ -51,6 +51,7 @@ The following table lists the configurable parameters of the OpenCart chart and
|-------------------------------------|-------------------------------------------|----------------------------------------------------------|
| `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` | OpenCart image registry | `docker.io` |
| `image.repository` | OpenCart Image name | `bitnami/opencart` |
| `image.tag` | OpenCart Image tag | `{TAG_NAME}` |
+21
View File
@@ -139,3 +139,24 @@ imagePullSecrets:
{{- end }}
{{- end -}}
{{- end -}}
{{/*
Return the proper Storage Class
*/}}
{{- define "opencart.storageClass" -}}
{{- $storageClass := "" }}
{{- if .Values.global -}}
{{- if .Values.global.storageClass -}}
{{- $storageClass = .Values.global.storageClass -}}
{{- else if .Values.persistence.opencart.storageClass -}}
{{- $storageClass = .Values.persistence.opencart.storageClass -}}
{{- end -}}
{{- else if .Values.persistence.opencart.storageClass -}}
{{- $storageClass = .Values.persistence.opencart.storageClass -}}
{{- end -}}
{{- if (eq "-" $storageClass) -}}
{{- printf "\"\"" -}}
{{- else }}
{{- printf "%s" $storageClass -}}
{{- end -}}
{{- end -}}
+1 -7
View File
@@ -14,11 +14,5 @@ spec:
resources:
requests:
storage: {{ .Values.persistence.opencart.size | quote }}
{{- if .Values.persistence.opencart.storageClass }}
{{- if (eq "-" .Values.persistence.opencart.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.opencart.storageClass }}"
{{- end }}
{{- end }}
storageClassName: {{ include "opencart.storageClass" . }}
{{- end -}}
+1
View File
@@ -6,6 +6,7 @@
# imageRegistry: myRegistryName
# imagePullSecrets:
# - myRegistryKeySecretName
# storageClass: myStorageClass
## Bitnami OpenCart image version
## ref: https://hub.docker.com/r/bitnami/opencart/tags/