Skip to content

Commit 3b41cb2

Browse files
committed
pr feedback
1 parent 432b566 commit 3b41cb2

File tree

5 files changed

+10
-18
lines changed

5 files changed

+10
-18
lines changed

production/helm/loki/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Entries should include a reference to the pull request that introduced the chang
1313

1414
## Unreleased
1515

16+
- [BUGFIX] Respect global registry in sidecar image [#19347](https://github.com/grafana/loki/pull/19347).
17+
1618
## 6.41.1
1719

1820
- [CHANGE] Changed version of Grafana Loki to 3.5.5.

production/helm/loki/templates/_helpers.tpl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,17 @@ Determines the final image path for the sidecar, respecting the global registry
199199
already contains a full registry (indicated by a dot '.') for backwards-compatibility.
200200
*/ -}}
201201

202-
{{- $registry := .Values.global.registry | default .Values.sidecar.image.registry | default "" -}}
203-
{{- $repo := .Values.sidecar.image.repository -}}
202+
{{- $image := .Values.sidecar.image }}
203+
{{- $registry := .Values.global.registry | default $image.registry | default "" -}}
204+
{{- $repo := $image.repository -}}
205+
{{- $ref := ternary (printf ":%s" $image.tag) (printf ":%s@sha256:%s" $image.tag $image.sha) (empty $image.sha) -}}
204206

205207
{{- $prefix := "" -}}
206208
{{- if and $registry (not (contains "." $repo)) -}}
207209
{{- $prefix = printf "%s/" $registry -}}
208210
{{- end -}}
209211

210-
{{- printf "%s%s" $prefix $repo -}}
212+
{{- printf "%s%s%s" $prefix $repo $ref -}}
211213
{{- end -}}
212214

213215
{{/*

production/helm/loki/templates/backend/statefulset-backend.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,7 @@ spec:
143143
{{- toYaml .Values.backend.resources | nindent 12 }}
144144
{{- if .Values.sidecar.rules.enabled }}
145145
- name: loki-sc-rules
146-
{{- if .Values.sidecar.image.sha }}
147-
image: "{{ include "loki.sidecarImage" . }}:{{ .Values.sidecar.image.tag }}@sha256:{{ .Values.sidecar.image.sha }}"
148-
{{- else }}
149-
image: "{{ include "loki.sidecarImage" . }}:{{ .Values.sidecar.image.tag }}"
150-
{{- end }}
146+
image: "{{ include "loki.sidecarImage" . }}"
151147
imagePullPolicy: {{ .Values.sidecar.image.pullPolicy }}
152148
env:
153149
- name: METHOD

production/helm/loki/templates/ruler/statefulset-ruler.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,7 @@ spec:
125125
{{- toYaml .Values.ruler.resources | nindent 12 }}
126126
{{- if and .Values.sidecar.rules.enabled .Values.ruler.sidecar }}
127127
- name: loki-sc-rules
128-
{{- if .Values.sidecar.image.sha }}
129-
image: "{{ include "loki.sidecarImage" . }}:{{ .Values.sidecar.image.tag }}@sha256:{{ .Values.sidecar.image.sha }}"
130-
{{- else }}
131-
image: "{{ include "loki.sidecarImage" . }}:{{ .Values.sidecar.image.tag }}"
132-
{{- end }}
128+
image: "{{ include "loki.sidecarImage" . }}"
133129
imagePullPolicy: {{ .Values.sidecar.image.pullPolicy }}
134130
env:
135131
- name: METHOD

production/helm/loki/templates/single-binary/statefulset.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,7 @@ spec:
150150
{{- toYaml .Values.singleBinary.resources | nindent 12 }}
151151
{{- if .Values.sidecar.rules.enabled }}
152152
- name: loki-sc-rules
153-
{{- if .Values.sidecar.image.sha }}
154-
image: "{{ include "loki.sidecarImage" . }}:{{ .Values.sidecar.image.tag }}@sha256:{{ .Values.sidecar.image.sha }}"
155-
{{- else }}
156-
image: "{{ include "loki.sidecarImage" . }}:{{ .Values.sidecar.image.tag }}"
157-
{{- end }}
153+
image: "{{ include "loki.sidecarImage" . }}"
158154
imagePullPolicy: {{ .Values.sidecar.image.pullPolicy }}
159155
env:
160156
- name: METHOD

0 commit comments

Comments
 (0)