Open mkopecny-cen88446 opened 6 months ago
the macro is assuming '.' has Values at the range, but then your passing a list: (list $ "linux-httpd.configmap") which has no .Values, so range is probably skipping over it?
the macro is assuming '.' has Values at the range, but then your passing a list: (list $ "linux-httpd.configmap") which has no .Values, so range is probably skipping over it?
No idea to be honest. I just followed documentation. The first item from range is rendered properly thought.
in values.yaml, you can define as
configmapvalues:
DATABASE_HOST: postgres-omnius
DATABASE_PORT: 5432
in configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Chart.Name }}-config
data:
{{- range $key, $val := .Values.configmapvalues }}
{{ $key }}: {{ $val | quote }}
{{- end }}
Hello,
I have pretty much the same issue as described here: https://stackoverflow.com/questions/77352107/cant-use-range-inside-library-chart-defined-template-in-helm
I have created a simple library chart following the documentation here: https://helm.sh/docs/topics/library_charts/#create-a-simple-library-chart
_configmap.yaml:
I want to create multiple ConfigMaps based on list variable in values.yaml:
In a chart I include this library in configmap.yaml:
I would expect 2 ConfigMap objects to be created but only the first one is. On other hand if I change configmap.yaml to:
then it works as expected. But I would also like to use the "merge" functionality mentioned in documentation. Would appreciate any help. Thank you.
helm version:
version.BuildInfo{Version:"v3.15.0-rc.2", GitCommit:"c4e37b39dbb341cb3f716220df9f9d306d123a58", GitTreeState:"clean", GoVersion:"go1.22.3"}
_util.tpl: