From 8ac94f8f60ba772194a480a14b37ea0c1258ff73 Mon Sep 17 00:00:00 2001 From: Konstantin Grachev Date: Tue, 6 Dec 2022 16:01:22 +0300 Subject: [PATCH] Use image version from Chart.AppVersion --- Chart.yaml | 2 +- templates/_helpers.tpl | 9 +++++++++ templates/deployment.yaml | 2 +- templates/migrations-job.yaml | 2 +- values.yaml | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index b82f861..6f4c7c7 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -3,7 +3,7 @@ name: hasura description: A Helm chart for Kubernetes type: application version: 0.2.6 -appVersion: v2.16.0 +appVersion: 2.16.0 icon: https://raw.githubusercontent.com/hasura/graphql-engine/master/assets/brand/powered_by_hasura_primary_lightbg.svg maintainers: - email: me@grachevko.ru diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 65b1dcf..363d2a4 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -60,3 +60,12 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{- define "hasura.image" -}} +{{- .Values.image.registry }}/{{ .Values.image.repository }}: +{{- if .Values.image.tag }} +{{- .Values.image.tag -}} +{{- else -}} +v{{ .Chart.AppVersion }}.cli-migrations-v3 +{{- end }} +{{- end }} diff --git a/templates/deployment.yaml b/templates/deployment.yaml index a1b8c7d..281bef1 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -31,7 +31,7 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: {{ include "hasura.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} envFrom: {{- if .Values.extraEnvVarsSecret }} diff --git a/templates/migrations-job.yaml b/templates/migrations-job.yaml index 1e843f2..04ee697 100644 --- a/templates/migrations-job.yaml +++ b/templates/migrations-job.yaml @@ -34,7 +34,7 @@ spec: mountPath: /shared-data containers: - name: migrate - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: {{- include "hasura.image" -}} command: [ "/bin/sh", "-c" ] args: - hasura-cli deploy diff --git a/values.yaml b/values.yaml index 119d956..fd03afb 100644 --- a/values.yaml +++ b/values.yaml @@ -9,7 +9,7 @@ image: repository: hasura/graphql-engine pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: v2.15.0.cli-migrations-v3 + tag: "" pullSecrets: [ ] extraEnvVarsSecret: ""