From a736271ad0a2f2fb57f0ea0e8464762d31dcbb4e Mon Sep 17 00:00:00 2001 From: Gary Pennington Date: Mon, 9 Oct 2023 17:44:20 +0100 Subject: [PATCH] rename template from common\. to apollo\. 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 --- helm/chart/router/templates/_helpers.tpl | 8 ++++---- helm/chart/router/templates/deployment.yaml | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/helm/chart/router/templates/_helpers.tpl b/helm/chart/router/templates/_helpers.tpl index 4ef0e7d94e..6289599c9e 100644 --- a/helm/chart/router/templates/_helpers.tpl +++ b/helm/chart/router/templates/_helpers.tpl @@ -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 }} @@ -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 -}} diff --git a/helm/chart/router/templates/deployment.yaml b/helm/chart/router/templates/deployment.yaml index 45d5822fd8..8ad8de3375 100644 --- a/helm/chart/router/templates/deployment.yaml +++ b/helm/chart/router/templates/deployment.yaml @@ -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 }} @@ -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 }} @@ -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: @@ -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: @@ -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 }}