Is there a way to pass multiple variables in template
or a function using include
? In my case I iterate over a list of items, but in the template I also need the .Release.Name
variable.
Is there a way to add to $client
the .Release.Name
? I tried something like {{ $client.Name := .Release.Name }}
, but it throws an error..
I have the following template:
{{- range $client := .Values.global.clients }}
{{- with $ }}
search.service-{{ $client.clientId }}.cfg: |
{{ include "rest-api.search" $client | indent 4}}
{{- end}}
{{- end}}
The rest-api.search function:
{{- define "rest-api.search" -}}
client.id={{ .clientId }}
id={{ .clientId }}
uri=http://{{ .Release.Name }}:11666/{index}/ws/{configuration}
default.index=quicksearch
default.configuration=form
query.sort=
query.filter=
query.dsf=word
query.lower=0
query.max=10
query.locale=de
query.query=*
# Index mapping
index.COMMON=quicksearch
index.REF=quicksearch
supportObjectGroup=true
# authorization scheme
authScheme=NONE
{{- end -}}
I appreciate your help. Thanks