Skip to content

Commit e43f5f1

Browse files
Update tools/deployment/spider-helm/templates/_helpers.tpl
Co-authored-by: Junhao Liao <junhao@junhao.ca>
1 parent 4086bfd commit e43f5f1

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

tools/deployment/spider-helm/templates/_helpers.tpl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,22 @@ app.kubernetes.io/instance: {{ .Release.Name }}
7474
{{- end }}
7575

7676
{{/*
77-
Creates a container image reference from `.Values.image.<component>`.
77+
Creates a container image reference from .Values.image.
7878
79-
The tag defaults to the chart's appVersion when the component omits it.
79+
Renders repository@digest when "digest" is set; otherwise, requires "tag" and renders repository:tag.
8080
8181
@param {object} root Root template context (required)
82-
@param {string} component Key under `.Values.image` (e.g. "storage", "mariadb")
83-
@return {string} Full image reference (repository:tag)
82+
@param {string} component Key under .Values.image (e.g., "storage", "mariadb")
83+
@return {string} Full image reference (repository@digest or repository:tag)
8484
*/}}
8585
{{- define "spider.imageRef" -}}
8686
{{- $img := index .root.Values.image .component -}}
87-
{{- $tag := $img.tag | default .root.Chart.AppVersion -}}
87+
{{- if $img.digest -}}
88+
{{- printf "%s@%s" $img.repository $img.digest -}}
89+
{{- else -}}
90+
{{- $tag := required (printf "image.%s.tag is required" .component) $img.tag -}}
8891
{{- printf "%s:%s" $img.repository $tag -}}
92+
{{- end -}}
8993
{{- end }}
9094

9195
{{/*

0 commit comments

Comments
 (0)