[stable/phabricator] Use global registry in secondary and/or metrics images (#12244)

Signed-off-by: Carlos Rodriguez Hernandez <crhernandez@bitnami.com>
This commit is contained in:
Carlos Rodríguez Hernández
2019-03-15 01:33:44 -07:00
committed by Kubernetes Prow Robot
parent a62c186cd6
commit 41a920cfdb
3 changed files with 18 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: phabricator
version: 4.1.0
version: 4.2.0
appVersion: 2019.10.0
description: Collection of open source web applications that help software companies build better software.
keywords:
+16 -3
View File
@@ -70,11 +70,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 "phabricator.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 -}}
{{/*
+1 -1
View File
@@ -131,7 +131,7 @@ spec:
mountPath: /bitnami/apache
{{- if .Values.metrics.enabled }}
- name: metrics
image: {{ template "metrics.image" . }}
image: {{ template "phabricator.metrics.image" . }}
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto']
ports: