Skip to content

Commit

Permalink
fix(argo-cd): Ensure app.kubernetes.io/version label is valid
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Parent <mathieu.parent@insee.fr>
  • Loading branch information
sathieu committed Jul 17, 2023
1 parent 6dab4fa commit ffcc070
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions charts/argo-cd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: v2.7.7
kubeVersion: ">=1.23.0-0"
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd
version: 5.39.0
version: 5.39.1
home: https://github.com/argoproj/argo-helm
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
sources:
Expand All @@ -26,5 +26,5 @@ annotations:
fingerprint: 2B8F22F57260EFA67BE1C5824B11F800CD9D2252
url: https://argoproj.github.io/argo-helm/pgp_keys.asc
artifacthub.io/changes: |
- kind: added
description: Allow configuring Dex's init image resources separately
- kind: fixed
description: Ensure `app.kubernetes.io/version` label is valid
9 changes: 8 additions & 1 deletion charts/argo-cd/templates/_common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/}}
Expand All @@ -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 }}
Expand Down

0 comments on commit ffcc070

Please sign in to comment.