Skip to content

Commit

Permalink
rename template from common\. to apollo\.
Browse files Browse the repository at this point in the history
There is a naming clash with bitnami common templates used in other
charts. This is unfortunate when used in a chart which has multiple
dependencies where names may clash.

The straightforward fix is to rename our templates from common to
apollo.

fixes: #4002
  • Loading branch information
garypen committed Oct 9, 2023
1 parent 913d391 commit a736271
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions helm/chart/router/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ https://github.com/bitnami/charts/blob/master/bitnami/common/templates/_tplvalue
Renders a value that contains template.
Usage:
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
{{ include "apollo.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
*/}}
{{- define "common.tplvalues.render" -}}
{{- define "apollo.tplvalues.render" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{- else }}
Expand All @@ -111,8 +111,8 @@ extraLabels:
custom-version: {{ .Chart.AppVersion }}
```
*/}}
{{- define "common.templatizeExtraLabels" -}}
{{- define "apollo.templatizeExtraLabels" -}}
{{- range $key, $value := .Values.extraLabels }}
{{ printf "%s: %s" $key (include "common.tplvalues.render" ( dict "value" $value "context" $))}}
{{ printf "%s: %s" $key (include "apollo.tplvalues.render" ( dict "value" $value "context" $))}}
{{- end -}}
{{- end -}}
12 changes: 6 additions & 6 deletions helm/chart/router/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
labels:
{{- include "router.labels" . | nindent 4 }}
{{- if .Values.extraLabels }}
{{- include "common.templatizeExtraLabels" . | trim | nindent 4 }}
{{- include "apollo.templatizeExtraLabels" . | trim | nindent 4 }}
{{- end }}
{{/* There may not be much configuration so check that there is something */}}
{{- if (((((.Values.router).configuration).telemetry).metrics).prometheus).enabled }}
Expand Down Expand Up @@ -34,7 +34,7 @@ spec:
labels:
{{- include "router.selectorLabels" . | nindent 8 }}
{{- if .Values.extraLabels }}
{{- include "common.templatizeExtraLabels" . | trim | nindent 8 }}
{{- include "apollo.templatizeExtraLabels" . | trim | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
Expand All @@ -46,7 +46,7 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
{{- if .Values.extraContainers }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraContainers "context" $) | nindent 8 }}
{{- include "apollo.tplvalues.render" (dict "value" .Values.extraContainers "context" $) | nindent 8 }}
{{- end }}
- name: {{ .Chart.Name }}
securityContext:
Expand Down Expand Up @@ -126,12 +126,12 @@ spec:
readOnly: true
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
{{- include "apollo.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.initContainers }}
initContainers:
{{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }}
{{- include "apollo.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }}
{{- end }}
{{- if or .Values.router.configuration .Values.extraVolumes }}
volumes:
Expand All @@ -141,7 +141,7 @@ spec:
name: {{ include "router.fullname" . }}
{{- end }}
{{- if .Values.extraVolumes }}
{{- include "common.tplvalues.render" ( dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
{{- include "apollo.tplvalues.render" ( dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
Expand Down

0 comments on commit a736271

Please sign in to comment.