fix(argo-cd): Ensure app.kubernetes.io/version label is valid (#2148)
Signed-off-by: Mathieu Parent <mathieu.parent@insee.fr>
This commit is contained in:
parent
6dab4fa326
commit
e053486fab
2 changed files with 11 additions and 4 deletions
|
|
@ -38,6 +38,13 @@ Create Argo CD app version
|
|||
{{- default .Chart.AppVersion .Values.global.image.tag }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return valid version label
|
||||
*/}}
|
||||
{{- define "argo-cd.versionLabelValue" -}}
|
||||
{{ regexReplaceAll "[^-A-Za-z0-9_.]" (include "argo-cd.defaultTag" .) "-" | trunc 63 | trimAll "-" | trimAll "_" | trimAll "." | quote }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
|
|
@ -46,7 +53,7 @@ helm.sh/chart: {{ include "argo-cd.chart" .context }}
|
|||
{{ include "argo-cd.selectorLabels" (dict "context" .context "component" .component "name" .name) }}
|
||||
app.kubernetes.io/managed-by: {{ .context.Release.Service }}
|
||||
app.kubernetes.io/part-of: argocd
|
||||
app.kubernetes.io/version: {{ include "argo-cd.defaultTag" .context }}
|
||||
app.kubernetes.io/version: {{ include "argo-cd.versionLabelValue" .context }}
|
||||
{{- with .context.Values.global.additionalLabels }}
|
||||
{{ toYaml . }}
|
||||
{{- end }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue