Skip to content

Commit 0bed220

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. Documents the migration path in the upgrade guide. Fixes grafana#20663
1 parent bf97280 commit 0bed220

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

docs/sources/setup/upgrade/_index.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,27 @@ Supported clients should check the configuration options for max send message si
4545

4646
## Helm Chart Upgrades
4747

48+
### Helm Chart 6.50.0 - Always prepend configured registry in image references
49+
50+
The dot-based heuristic introduced in Helm chart 6.50.0 to detect an embedded registry in the `repository` field has been removed. Previously, if the `repository` value contained a dot (e.g., `mirror.gcr.io/grafana/loki`), any configured `registry` (both service-level and `global.imageRegistry`) was silently ignored.
51+
52+
The chart now always prepends the configured registry, which is consistent with the behavior before Helm chart 6.50.0 and with other Grafana Helm charts.
53+
54+
**Action required:** If you are embedding a full registry path in the `repository` field (e.g., `loki.image.repository: private.registry.com/grafana/loki`), split it into separate `registry` and `repository` fields:
55+
56+
```yaml
57+
# Before (deprecated pattern)
58+
loki:
59+
image:
60+
repository: private.registry.com/grafana/loki
61+
62+
# After
63+
loki:
64+
image:
65+
registry: private.registry.com
66+
repository: grafana/loki
67+
```
68+
4869
### Helm Chart 6.50.0 - Respect the global registry in the sidecar image
4970
5071
If you prefixed the sidecar container with a private registry (`sidecar.image.repository`), this is no longer necessary and is deprecated as the global registry is used starting with Helm chart 6.46.1. Therefore please use `global.imageRegistry` or alternatively, `sidecar.image.registry` for more fine-grained control.

production/helm/loki/templates/_helpers.tpl

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

167167
{{/*
168168
Base template for building docker image reference
169-
Determines the final image name, respecting the global registry if defined, unless the local repository
170-
already contains a full registry (indicated by a dot '.') for backwards-compatibility.
169+
Always prepends the registry when one is configured (global or service-level).
171170
It also respects `.digest` as well as `.sha` (deprecated).
172171
*/}}
173172
{{- define "loki.baseImage" }}
@@ -178,8 +177,7 @@ It also respects `.digest` as well as `.sha` (deprecated).
178177
{{- $ref := ternary (printf ":%s" (.service.tag | default .defaultVersion | toString)) ($digest) (empty $digest) -}}
179178

180179
{{- $prefix := "" -}}
181-
{{- $firstSegment := (split "/" $repository)._0 -}}
182-
{{- if and $registry (not (contains "." $firstSegment)) -}}
180+
{{- if $registry -}}
183181
{{- $prefix = printf "%s/" $registry -}}
184182
{{- end -}}
185183

0 commit comments

Comments
 (0)