Skip to content

Commit

Permalink
Merge pull request #2748 from pvallone/users/pvallone/extra-init-cont…
Browse files Browse the repository at this point in the history
…ainer-global-image-registry

[grafana] Add global image registry support for extraInitContainers
  • Loading branch information
zanhsieh authored Oct 31, 2023
2 parents fdb555b + a700858 commit d9ef6ab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/grafana/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: grafana
version: 7.0.1
version: 7.0.2
appVersion: 10.1.5
kubeVersion: "^1.8.0-0"
description: The leading tool for querying and visualizing time series and metrics.
Expand Down
15 changes: 13 additions & 2 deletions charts/grafana/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,19 @@ initContainers:
- name: sc-notifiers-volume
mountPath: "/etc/grafana/provisioning/notifiers"
{{- end}}
{{- with .Values.extraInitContainers }}
{{- tpl (toYaml .) $root | nindent 2 }}
{{- if .Values.extraInitContainers }}
{{- range $eic := .Values.extraInitContainers }}
- name: {{ $eic.name }}
{{- $registry := $.Values.global.imageRegistry | default $eic.image.registry -}}
{{- if $eic.image.sha }}
image: "{{ $registry }}/{{ $eic.image.repository }}:{{ $eic.image.tag }}@sha256:{{ $eic.image.sha }}"
{{- else }}
image: "{{ $registry }}/{{ $eic.image.repository }}:{{ $eic.image.tag }}"
{{- end }}
imagePullPolicy: {{ $eic.image.pullPolicy }}
volumeMounts:
{{ toYaml $eic.volumeMounts | indent 6 }}
{{- end }}
{{- end }}
{{- if or .Values.image.pullSecrets .Values.global.imagePullSecrets }}
imagePullSecrets:
Expand Down

0 comments on commit d9ef6ab

Please sign in to comment.