Skip to content

Commit 815140f

Browse files
DrFaust92claude
andauthored
[tempo-distributed] Generic imagePullSecrets helper to remove per-component duplication (#191)
* [tempo-distributed] Replace per-component imagePullSecrets helpers with a single generic helper Each component had its own _helpers file containing an identical imagePullSecrets wrapper. This consolidates them into a single `tempo.componentImagePullSecrets` helper in _helpers.tpl that dynamically resolves the component's values section, following the same pattern already used by `tempo.imageReference`. Signed-off-by: Ilia <ilia.lazebnik@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * [tempo-distributed] Bump chart version to 2.6.5 Signed-off-by: Ilia <ilia.lazebnik@gmail.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Signed-off-by: Ilia <ilia.lazebnik@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a4928d1 commit 815140f

25 files changed

+35
-95
lines changed

charts/tempo-distributed/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: tempo-distributed
33
description: Grafana Tempo in MicroService mode
44
type: application
5-
version: 2.6.4
5+
version: 2.6.5
66
# renovate: docker=docker.io/grafana/tempo
77
appVersion: 2.10.3
88
kubeVersion: "^1.25.0-0"

charts/tempo-distributed/templates/_helpers.tpl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,28 @@ imagePullSecrets:
4747
{{- end }}
4848
{{- end -}}
4949

50+
{{/*
51+
Generic component imagePullSecrets. Resolves the component's values section
52+
dynamically, following the same pattern as tempo.imageReference.
53+
Params:
54+
ctx = root context (.)
55+
component = component name (e.g., "distributor", "query-frontend")
56+
noTempoFallback = optional, when true the tempo image is not used as fallback (for non-tempo images like gateway)
57+
*/}}
58+
{{- define "tempo.componentImagePullSecrets" -}}
59+
{{- $componentSection := include "tempo.componentSectionFromName" . -}}
60+
{{- if not (hasKey .ctx.Values $componentSection) -}}
61+
{{- print "Component section " $componentSection " does not exist" | fail -}}
62+
{{- end -}}
63+
{{- $component := (index .ctx.Values $componentSection).image | default dict -}}
64+
{{- $tempo := .ctx.Values.tempo.image -}}
65+
{{- if .noTempoFallback -}}
66+
{{- $tempo = dict -}}
67+
{{- end -}}
68+
{{- $dict := dict "tempo" $tempo "component" $component "global" .ctx.Values.global.image -}}
69+
{{- include "tempo.imagePullSecrets" $dict -}}
70+
{{- end -}}
71+
5072
{{/*
5173
Create chart name and version as used by the chart label.
5274
*/}}

charts/tempo-distributed/templates/admin-api/_helpers.tpl

Lines changed: 0 additions & 7 deletions
This file was deleted.

charts/tempo-distributed/templates/admin-api/admin-api-dep.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ spec:
3838
{{- with .Values.adminApi.initContainers }}
3939
{{- toYaml . | nindent 8 }}
4040
{{- end }}
41-
{{- include "tempo.adminApiImagePullSecrets" . | nindent 6 -}}
41+
{{- include "tempo.componentImagePullSecrets" (dict "ctx" . "component" "admin-api") | nindent 6 -}}
4242
{{- with .Values.adminApi.hostAliases }}
4343
hostAliases:
4444
{{- toYaml . | nindent 8 }}

charts/tempo-distributed/templates/compactor/_helpers-compactor.tpl

Lines changed: 0 additions & 7 deletions
This file was deleted.

charts/tempo-distributed/templates/compactor/deployment-compactor.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
{{- toYaml . | nindent 8 }}
5252
{{- end }}
5353
enableServiceLinks: false
54-
{{- include "tempo.compactorImagePullSecrets" . | nindent 6 -}}
54+
{{- include "tempo.componentImagePullSecrets" (dict "ctx" . "component" "compactor") | nindent 6 -}}
5555
{{- with .Values.compactor.hostAliases }}
5656
hostAliases:
5757
{{- toYaml . | nindent 8 }}

charts/tempo-distributed/templates/distributor/_helpers-distributor.tpl

Lines changed: 0 additions & 7 deletions
This file was deleted.

charts/tempo-distributed/templates/distributor/deployment-distributor.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
{{- toYaml . | nindent 8 }}
5252
{{- end }}
5353
enableServiceLinks: false
54-
{{- include "tempo.distributorImagePullSecrets" . | nindent 6 -}}
54+
{{- include "tempo.componentImagePullSecrets" (dict "ctx" . "component" "distributor") | nindent 6 -}}
5555
{{- with .Values.distributor.hostAliases }}
5656
hostAliases:
5757
{{- toYaml . | nindent 8 }}

charts/tempo-distributed/templates/enterprise-federation-frontend/_helpers-federation-frontend.tpl

Lines changed: 0 additions & 7 deletions
This file was deleted.

charts/tempo-distributed/templates/enterprise-federation-frontend/deployment-federation-frontend.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ spec:
5252
{{- toYaml . | nindent 8 }}
5353
{{- end }}
5454
enableServiceLinks: false
55-
{{- include "tempo.enterpriseFederationFrontendImagePullSecrets" . | nindent 6 -}}
55+
{{- include "tempo.componentImagePullSecrets" (dict "ctx" . "component" "enterprise-federation-frontend") | nindent 6 -}}
5656
{{- with .Values.enterpriseFederationFrontend.hostAliases }}
5757
hostAliases:
5858
{{- toYaml . | nindent 8 }}

0 commit comments

Comments
 (0)