From fb9b2786cb4a3558cb64d0ded2fb3d2d6e44f31e Mon Sep 17 00:00:00 2001 From: Johannes Pusch Date: Wed, 13 May 2026 10:36:06 +0200 Subject: [PATCH 1/2] fix(helm): make image.tag or image.digest mandatory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the appVersion fallback in the image helper — if neither tag nor digest is set, helm now fails with a clear error. If both are set, digest takes precedence. Bump chart version 1.3.0 -> 1.3.1. --- charts/registry/Chart.yaml | 2 +- charts/registry/templates/_helpers.tpl | 5 +++-- charts/registry/templates/deployment.yaml | 2 +- charts/registry/values.yaml | 3 +-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/registry/Chart.yaml b/charts/registry/Chart.yaml index 9c8b982..faf5491 100644 --- a/charts/registry/Chart.yaml +++ b/charts/registry/Chart.yaml @@ -5,7 +5,7 @@ name: registry # 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. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.3.0 +version: 1.3.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. diff --git a/charts/registry/templates/_helpers.tpl b/charts/registry/templates/_helpers.tpl index 259e2aa..5de5857 100644 --- a/charts/registry/templates/_helpers.tpl +++ b/charts/registry/templates/_helpers.tpl @@ -76,11 +76,12 @@ Create the name of the service account to use {{/* Util function for generating the image URL based on the provided options. +Either image.tag or image.digest must be set explicitly; no fallback to appVersion. */}} {{- define "registry.image" -}} -{{- $defaultTag := index . 1 -}} {{- with index . 0 -}} +{{- if not (or .digest .tag) -}}{{ fail "Either image.tag or image.digest must be set" }}{{- end -}} {{- if .registry -}}{{ printf "%s/%s" .registry .repository }}{{- else -}}{{- .repository -}}{{- end -}} -{{- if .digest -}}{{ printf "@%s" .digest }}{{- else -}}{{ printf ":%s" (default $defaultTag .tag) }}{{- end -}} +{{- if .digest -}}{{ printf "@%s" .digest }}{{- else -}}{{ printf ":%s" .tag }}{{- end -}} {{- end }} {{- end }} diff --git a/charts/registry/templates/deployment.yaml b/charts/registry/templates/deployment.yaml index 7c9efe7..4f87a26 100644 --- a/charts/registry/templates/deployment.yaml +++ b/charts/registry/templates/deployment.yaml @@ -48,7 +48,7 @@ spec: securityContext: {{- toYaml . | nindent 12 }} {{- end }} - image: "{{ template "registry.image" (tuple .Values.image $.Chart.AppVersion) }}" + image: "{{ template "registry.image" (tuple .Values.image) }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- with .Values.image.command }} command: ["{{- toYaml . }}"] diff --git a/charts/registry/values.yaml b/charts/registry/values.yaml index 8e61049..add5064 100644 --- a/charts/registry/values.yaml +++ b/charts/registry/values.yaml @@ -35,9 +35,8 @@ image: repository: images/registry # Override the image tag to deploy by setting this variable. - # If no value is set, the chart's appVersion is used. # +docs:property - # tag: 0.0.1 + tag: latest # Setting a digest will override any tag. # +docs:property From 7b2f04b1f358b71e72f488229505f4dc7f5ec451 Mon Sep 17 00:00:00 2001 From: Chris Burkert Date: Wed, 13 May 2026 17:09:26 +0200 Subject: [PATCH 2/2] fix: do not default to a tag --- charts/registry/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/registry/values.yaml b/charts/registry/values.yaml index add5064..9ca92d0 100644 --- a/charts/registry/values.yaml +++ b/charts/registry/values.yaml @@ -36,7 +36,7 @@ image: # Override the image tag to deploy by setting this variable. # +docs:property - tag: latest + # tag: 0.0.1 # Setting a digest will override any tag. # +docs:property