Skip to content

Commit 3e48398

Browse files
committed
fix(helm): Always respect configured registry in image references
Remove the dot-based heuristic that skipped prepending the registry when the repository contained a dot. This caused explicitly configured registries (both service-level and global) to be silently ignored for repositories with dots in their path (e.g. mirror.gcr.io/grafana/loki). Restores the pre-grafana#19347 behavior of always prepending the registry. Fixes grafana#20663
1 parent 5cb7d11 commit 3e48398

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

production/helm/loki/templates/_helpers.tpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ Create the name of the service account to use
163163

164164
{{/*
165165
Base template for building docker image reference
166-
Determines the final image name, respecting the global registry if defined, unless the local repository
167-
already contains a full registry (indicated by a dot '.') for backwards-compatibility.
166+
Always prepends the registry when one is configured (global or service-level).
168167
It also respects `.digest` as well as `.sha` (deprecated).
169168
*/}}
170169
{{- define "loki.baseImage" }}
@@ -175,7 +174,7 @@ It also respects `.digest` as well as `.sha` (deprecated).
175174
{{- $ref := ternary (printf ":%s" (.service.tag | default .defaultVersion | toString)) ($digest) (empty $digest) -}}
176175

177176
{{- $prefix := "" -}}
178-
{{- if and $registry (not (contains "." $repository)) -}}
177+
{{- if $registry -}}
179178
{{- $prefix = printf "%s/" $registry -}}
180179
{{- end -}}
181180

0 commit comments

Comments
 (0)