fix: modify jobs.image.tag for eks

EKS sometimes has a '+' in kubernetes minor version
This results in invalid image tag for jobs
This commit is contained in:
Tom OBrien
2022-01-18 16:26:24 +00:00
committed by Dario Tranchitella
parent 1bbaebbc90
commit 0b199f4136
2 changed files with 13 additions and 3 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ sources:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.1.5
version: 0.1.6
# This is the version number of the application being deployed.
# This version number should be incremented each time you make changes to the application.
+12 -2
View File
@@ -91,6 +91,17 @@ Create the proxy fully-qualified Docker image to use
{{- printf "%s:%s" .Values.proxy.image.repository .Values.proxy.image.tag -}}
{{- end }}
{{/*
Determine the Kubernetes version to use for jobsFullyQualifiedDockerImage tag
*/}}
{{- define "capsule.jobsTagKubeVersion" -}}
{{- if contains "-eks-" .Capabilities.KubeVersion.GitVersion }}
{{- print "v" .Capabilities.KubeVersion.Major "." (.Capabilities.KubeVersion.Minor | replace "+" "") -}}
{{- else }}
{{- print "v" .Capabilities.KubeVersion.Major "." .Capabilities.KubeVersion.Minor -}}
{{- end }}
{{- end }}
{{/*
Create the jobs fully-qualified Docker image to use
*/}}
@@ -98,8 +109,7 @@ Create the jobs fully-qualified Docker image to use
{{- if .Values.jobs.image.tag }}
{{- printf "%s:%s" .Values.jobs.image.repository .Values.jobs.image.tag -}}
{{- else }}
{{- $kubeversion := print "v" .Capabilities.KubeVersion.Major "." .Capabilities.KubeVersion.Minor -}}
{{- printf "%s:%s" .Values.jobs.image.repository $kubeversion -}}
{{- printf "%s:%s" .Values.jobs.image.repository (include "capsule.jobsTagKubeVersion" .) -}}
{{- end }}
{{- end }}