From f382390ea2f6f7cca1ded4bbd9e48f3116299e06 Mon Sep 17 00:00:00 2001 From: Florian Ruechel Date: Sun, 7 Dec 2025 13:50:05 +1030 Subject: [PATCH 1/2] Ensure version tag matches deployed version When overriding `image.tag` the version label should also show the correct version. Previously, the label would always be AppVersion, even if the user had provided a different image tag (thus deploying a different Nextcloud version). With this change, the version is always first derived from the image tag and only from AppVersion if not tag was provided. For the "nextcloud.image" helper this was already the case, now the "version" label on all resources also does this. Signed-off-by: Florian Ruechel --- charts/nextcloud/Chart.yaml | 2 +- charts/nextcloud/templates/_helpers.tpl | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index 3633ea10..db560bbd 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 8.6.0 +version: 8.7.0 # renovate: image=docker.io/library/nextcloud appVersion: 32.0.2 description: A file sharing server that puts the control and security of your own data back into your hands. diff --git a/charts/nextcloud/templates/_helpers.tpl b/charts/nextcloud/templates/_helpers.tpl index 934226e4..f938a7ce 100644 --- a/charts/nextcloud/templates/_helpers.tpl +++ b/charts/nextcloud/templates/_helpers.tpl @@ -42,11 +42,14 @@ Create chart name and version as used by the chart label. Create image name that is used in the deployment */}} {{- define "nextcloud.image" -}} -{{- if .Values.image.tag -}} -{{- printf "%s/%s:%s" (coalesce .Values.global.image.registry .Values.image.registry) .Values.image.repository .Values.image.tag -}} -{{- else -}} -{{- printf "%s/%s:%s-%s" (coalesce .Values.global.image.registry .Values.image.registry) .Values.image.repository .Chart.AppVersion .Values.image.flavor -}} +{{- printf "%s/%s:%s" (coalesce .Values.global.image.registry .Values.image.registry) .Values.image.repository (include "nextcloud.version" .) -}} {{- end -}} + +{{/* +Return Nextcloud version from either image tag or AppVersion +*/}} +{{- define "nextcloud.version" -}} +{{- .Values.image.tag | default .Chart.AppVersion }} {{- end -}} @@ -445,7 +448,7 @@ Parameters: {{ include "nextcloud.selectorLabels" ( dict "component" .component "rootContext" .rootContext) }} helm.sh/chart: {{ include "nextcloud.chart" .rootContext }} app.kubernetes.io/managed-by: {{ .rootContext.Release.Service }} -{{- with .rootContext.Chart.AppVersion }} +{{- with (include "nextcloud.version" .rootContext) }} app.kubernetes.io/version: {{ quote . }} {{- end }} {{- end -}} From e9a214a22cfa55d2af2d8e130f626c2876ea18ac Mon Sep 17 00:00:00 2001 From: Florian Ruechel Date: Sat, 13 Dec 2025 12:51:44 +1030 Subject: [PATCH 2/2] Fix missing flavor Signed-off-by: Florian Ruechel --- charts/nextcloud/templates/_helpers.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/nextcloud/templates/_helpers.tpl b/charts/nextcloud/templates/_helpers.tpl index f938a7ce..a671011a 100644 --- a/charts/nextcloud/templates/_helpers.tpl +++ b/charts/nextcloud/templates/_helpers.tpl @@ -42,7 +42,10 @@ Create chart name and version as used by the chart label. Create image name that is used in the deployment */}} {{- define "nextcloud.image" -}} +{{- if .Values.image.tag -}} {{- printf "%s/%s:%s" (coalesce .Values.global.image.registry .Values.image.registry) .Values.image.repository (include "nextcloud.version" .) -}} +{{- else -}} +{{- printf "%s/%s:%s-%s" (coalesce .Values.global.image.registry .Values.image.registry) .Values.image.repository (include "nextcloud.version" .) .Values.image.flavor -}} {{- end -}} {{/*