From 618470e8e1d47f91dd98165e93a58dd8862d6367 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Tue, 23 Jan 2024 22:23:19 +0530 Subject: [PATCH] feat(chart): templating in name(Override) for new object [deploy] Signed-off-by: Viet Nguyen Duc --- charts/selenium-grid/templates/_helpers.tpl | 13 ++++++++++--- .../selenium-grid/templates/recorder-configmap.yaml | 2 +- .../selenium-grid/templates/uploader-configmap.yaml | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index c41e6d604..ee293c1eb 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -235,10 +235,17 @@ Service Account fullname {{- end -}} {{/* -Video ConfigMap fullname +Recorder ConfigMap fullname */}} -{{- define "seleniumGrid.video.fullname" -}} -{{- tpl (default "selenium-video" .Values.videoRecorder.nameOverride) $ | trunc 63 | trimSuffix "-" -}} +{{- define "seleniumGrid.recorder.fullname" -}} +{{- tpl (default "selenium-recorder-config" .Values.recorderConfigMap.name) $ | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Uploader ConfigMap fullname +*/}} +{{- define "seleniumGrid.uploader.fullname" -}} +{{- tpl (default "selenium-uploader-config" .Values.uploaderConfigMap.name) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* diff --git a/charts/selenium-grid/templates/recorder-configmap.yaml b/charts/selenium-grid/templates/recorder-configmap.yaml index c573d2c9f..d11dd3fd5 100644 --- a/charts/selenium-grid/templates/recorder-configmap.yaml +++ b/charts/selenium-grid/templates/recorder-configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.recorderConfigMap.name }} + name: {{ template "seleniumGrid.recorder.fullname" $ }} namespace: {{ .Release.Namespace }} {{- with .Values.recorderConfigMap.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/selenium-grid/templates/uploader-configmap.yaml b/charts/selenium-grid/templates/uploader-configmap.yaml index 912b0fd83..bf36f9600 100644 --- a/charts/selenium-grid/templates/uploader-configmap.yaml +++ b/charts/selenium-grid/templates/uploader-configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.uploaderConfigMap.name }} + name: {{ template "seleniumGrid.uploader.fullname" $ }} namespace: {{ .Release.Namespace }} {{- with .Values.uploaderConfigMap.annotations }} annotations: {{- toYaml . | nindent 4 }}