mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 08:37:03 +02:00
24 lines
827 B
Smarty
24 lines
827 B
Smarty
{{/*
|
|
Convert configMap values to an object
|
|
*/}}
|
|
{{- define "bjw-s.common.lib.configMap.valuesToObject" -}}
|
|
{{- $rootContext := .rootContext -}}
|
|
{{- $identifier := .id -}}
|
|
{{- $objectValues := .values -}}
|
|
|
|
{{- /* Determine and inject the configMap name */ -}}
|
|
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
|
|
|
{{- if $objectValues.nameOverride -}}
|
|
{{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}}
|
|
{{- else -}}
|
|
{{- if ne $identifier "main" -}}
|
|
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- $_ := set $objectValues "name" $objectName -}}
|
|
{{- $_ := set $objectValues "identifier" $identifier -}}
|
|
|
|
{{- /* Return the configMap object */ -}}
|
|
{{- $objectValues | toYaml -}}
|
|
{{- end -}}
|