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 go-templates 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 kubernetes-helm 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 go-templates language and specifically involve the Sprig extensions. Questions with this tag will almost always also be tagged with go-templates, and generally also with the main tool being used such as kubernetes-helm or helmfile.