diff --git a/stable/wordpress/Chart.yaml b/stable/wordpress/Chart.yaml index 13d771f0a3..3abd8953cc 100644 --- a/stable/wordpress/Chart.yaml +++ b/stable/wordpress/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: wordpress -version: 5.6.1 +version: 5.7.0 appVersion: 5.1.1 description: Web publishing platform for building blogs and websites. icon: https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png diff --git a/stable/wordpress/templates/_helpers.tpl b/stable/wordpress/templates/_helpers.tpl index 4ac220d262..fe4bd97a29 100644 --- a/stable/wordpress/templates/_helpers.tpl +++ b/stable/wordpress/templates/_helpers.tpl @@ -63,11 +63,24 @@ Create chart name and version as used by the chart label. {{/* Return the proper image name (for the metrics image) */}} -{{- define "metrics.image" -}} -{{- $registryName := .Values.metrics.image.registry -}} +{{- define "wordpress.metrics.image" -}} +{{- $registryName := .Values.metrics.image.registry -}} {{- $repositoryName := .Values.metrics.image.repository -}} {{- $tag := .Values.metrics.image.tag | toString -}} -{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} {{- end -}} {{/* diff --git a/stable/wordpress/templates/deployment.yaml b/stable/wordpress/templates/deployment.yaml index 8ba0c32ee5..bdf7cac14f 100644 --- a/stable/wordpress/templates/deployment.yaml +++ b/stable/wordpress/templates/deployment.yaml @@ -177,7 +177,7 @@ spec: {{ toYaml .Values.resources | indent 10 }} {{- if .Values.metrics.enabled }} - name: metrics - image: {{ template "metrics.image" . }} + image: {{ template "wordpress.metrics.image" . }} imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] ports: