[stable/redis] Refactor StorageClass template to support old Helm versions (#16480)

* Refactor StorageClass template to support old Helm versions

Signed-off-by: Miguel A. Cabrera Minagorri <macabrera@bitnami.com>

* [stable/redis] Update components versions

Signed-off-by: Bitnami Containers <containers@bitnami.com>
This commit is contained in:
Miguel Ángel Cabrera Miñagorri
2019-08-21 07:37:28 -07:00
committed by Kubernetes Prow Robot
parent 149fd16232
commit 5ef4e566b0
4 changed files with 57 additions and 27 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: redis
version: 9.1.0
version: 9.1.1
appVersion: 5.0.5
description: Open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.
keywords:
+52 -22
View File
@@ -239,41 +239,71 @@ WARNING: Rolling tag detected ({{ .Values.sentinel.image.repository }}:{{ .Value
{{- end -}}
{{/*
Return the proper Storage Class
Return the proper Storage Class for master
*/}}
{{- define "redis.master.storageClass" -}}
{{- $storageClass := "" }}
{{- if .Values.master.persistence.storageClass -}}
{{- $storageClass = .Values.master.persistence.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.master.persistence.storageClass -}}
{{- if (eq "-" .Values.master.persistence.storageClass) -}}
{{- printf "\"\"" -}}
{{- else }}
{{- printf "%s" .Values.master.persistence.storageClass -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- else -}}
{{- if .Values.master.persistence.storageClass -}}
{{- if (eq "-" .Values.master.persistence.storageClass) -}}
{{- printf "\"\"" -}}
{{- else }}
{{- printf "%s" .Values.master.persistence.storageClass -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if (eq "-" $storageClass) -}}
{{- printf "\"\"" -}}
{{- else }}
{{- printf "%s" $storageClass -}}
{{- end -}}
{{- end -}}
{{/*
Return the proper Storage Class
Return the proper Storage Class for slave
*/}}
{{- define "redis.slave.storageClass" -}}
{{- $storageClass := "" }}
{{- if .Values.slave.persistence.storageClass -}}
{{- $storageClass = .Values.slave.persistence.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.slave.persistence.storageClass -}}
{{- if (eq "-" .Values.slave.persistence.storageClass) -}}
{{- printf "\"\"" -}}
{{- else }}
{{- printf "%s" .Values.slave.persistence.storageClass -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- else -}}
{{- if .Values.slave.persistence.storageClass -}}
{{- if (eq "-" .Values.slave.persistence.storageClass) -}}
{{- printf "\"\"" -}}
{{- else }}
{{- printf "%s" .Values.slave.persistence.storageClass -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if (eq "-" $storageClass) -}}
{{- printf "\"\"" -}}
{{- else }}
{{- printf "%s" $storageClass -}}
{{- end -}}
{{- end -}}
+2 -2
View File
@@ -17,7 +17,7 @@ image:
## Bitnami Redis image tag
## ref: https://github.com/bitnami/bitnami-docker-redis#supported-tags-and-respective-dockerfile-links
##
tag: 5.0.5-debian-9-r95
tag: 5.0.5-debian-9-r104
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
@@ -443,7 +443,7 @@ metrics:
image:
registry: docker.io
repository: bitnami/redis-exporter
tag: 1.0.4-debian-9-r4
tag: 1.1.0-debian-9-r1
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
+2 -2
View File
@@ -17,7 +17,7 @@ image:
## Bitnami Redis image tag
## ref: https://github.com/bitnami/bitnami-docker-redis#supported-tags-and-respective-dockerfile-links
##
tag: 5.0.5-debian-9-r95
tag: 5.0.5-debian-9-r104
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
@@ -443,7 +443,7 @@ metrics:
image:
registry: docker.io
repository: bitnami/redis-exporter
tag: 1.0.4-debian-9-r4
tag: 1.1.0-debian-9-r1
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.