Questions tagged [sprig-template-functions]

Questions about using the Sprig template functions. These are extensions to the Go text/template syntax that provide a variety of common support functions, including string and list manipulation. They are included in tools like Helm.

Sprig is a set of extension functions to the system. These support Go data types such as slices (lists) and maps (dictionaries), and provide a set of basic string-manipulation and arithmetic functions.

For example, a chart could be configured with a list of options that needs to be passed as a comma-separated list. In the core Go text/template language, you would need a complex range loop, but you can directly use the Sprig join function instead:

- name: OPTIONS
  value: {{ .Values.options | join "," }}
  #                           ^^^^

Use this tag on questions that use the language and specifically involve the Sprig extensions. Questions with this tag will almost always also be tagged with , and generally also with the main tool being used such as or .

46 questions
0
votes
1 answer

Cannot convert the output of readFile into List for iteration

I am using helmfile for my helm releases. I have a yaml file projects.yaml # projects.yaml - yako - pera - okta In values.yaml.gotmpl, i want to iterate thru the content of projects.yaml : # values.yaml.gotmpl {{ $projects := readFile…
Abdennour TOUMI
  • 87,526
  • 38
  • 249
  • 254
1 2 3
4