From 50d805606dc28da76f06524fe2c75bfcbef1ac62 Mon Sep 17 00:00:00 2001 From: Alessio Caiazza Date: Mon, 30 Mar 2020 17:20:23 +0200 Subject: [PATCH] Override gitlab.versionTag with VERSION file In the scope of automating auto-deploy tagging for gitlab charts, instead of rewriting all the subchart files to edit appVersion we can override gitlab.versionTag reading from VERSION file if present --- charts/gitlab/templates/_helpers.tpl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/charts/gitlab/templates/_helpers.tpl b/charts/gitlab/templates/_helpers.tpl index 6424a3ac21..5de98b85ed 100644 --- a/charts/gitlab/templates/_helpers.tpl +++ b/charts/gitlab/templates/_helpers.tpl @@ -2,11 +2,12 @@ {{/* Return the version tag used to fetch the GitLab images -Defaults to using the information from the chart appVersion field, but can be -overridden using the global.gitlabVersion field in values. +Defaults to using the information from the chart VERSION file or the appVersion field, +but can be overridden using the global.gitlabVersion field in values. */}} {{- define "gitlab.versionTag" -}} -{{- template "gitlab.parseAppVersion" (dict "appVersion" (coalesce .Values.global.gitlabVersion .Chart.AppVersion) "prepend" "true") -}} +{{- $appVersion := .Files.Get "VERSION" | default .Chart.AppVersion -}} +{{- template "gitlab.parseAppVersion" (dict "appVersion" (coalesce .Values.global.gitlabVersion $appVersion) "prepend" "true") -}} {{- end -}} {{/* -- GitLab