fix: trim optional docker digest from version labels (#772)

Closes #771

Reviewed-on: https://code.forgejo.org/forgejo-helm/forgejo-helm/pulls/772
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
This commit is contained in:
Michael Kriese 2024-08-16 13:28:43 +00:00
parent 159a7636fc
commit 1c1768245a
No known key found for this signature in database
GPG key ID: F8D7748549A5986A

View file

@ -32,6 +32,14 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Get version from .Values.image.tag or Chart.AppVersion.
Trim optional docker digest.
*/}}
{{- define "gitea.version" -}}
{{- regexReplaceAll "@.+" (.Values.image.tag | default .Chart.AppVersion | toString) "" -}}
{{- end -}}
{{/*
Create image name and tag used by the deployment.
*/}}
@ -87,8 +95,8 @@ Common labels
helm.sh/chart: {{ include "gitea.chart" . }}
app: {{ include "gitea.name" . }}
{{ include "gitea.selectorLabels" . }}
app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
version: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
app.kubernetes.io/version: {{ include "gitea.version" . | quote }}
version: {{ include "gitea.version" . | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}