diff --git a/stable/owncloud/Chart.yaml b/stable/owncloud/Chart.yaml index 8885bffaa6..93e0acde80 100644 --- a/stable/owncloud/Chart.yaml +++ b/stable/owncloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: owncloud -version: 4.1.0 +version: 4.2.0 appVersion: 10.1.0 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: diff --git a/stable/owncloud/templates/_helpers.tpl b/stable/owncloud/templates/_helpers.tpl index 31c92efbee..1e3ad787d9 100644 --- a/stable/owncloud/templates/_helpers.tpl +++ b/stable/owncloud/templates/_helpers.tpl @@ -77,11 +77,24 @@ Also, we can't use a single if because lazy evaluation is not an option {{/* Return the proper image name (for the metrics image) */}} -{{- define "metrics.image" -}} -{{- $registryName := .Values.metrics.image.registry -}} +{{- define "owncloud.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/owncloud/templates/deployment.yaml b/stable/owncloud/templates/deployment.yaml index a4a996f9d2..adf11b3c16 100644 --- a/stable/owncloud/templates/deployment.yaml +++ b/stable/owncloud/templates/deployment.yaml @@ -115,7 +115,7 @@ spec: mountPath: /bitnami/apache {{- if .Values.metrics.enabled }} - name: metrics - image: {{ template "metrics.image" . }} + image: {{ template "owncloud.metrics.image" . }} imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto'] ports: