Sprig dict

From NovaOrdis Knowledge Base
Revision as of 22:36, 19 October 2020 by Ovidiu (talk | contribs) (→‎Helm Patterns)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

External

Internal

Overview

A dict instance is used as the root scope by Helm while rendering templates. dict instances can also be used to pass arguments to sub-templates:

Passing Arguments to Sub-templates

Helm Patterns

Creating a dict:

{{- $ExampleDict := dict -}}
{{- $ExampleDict := dict "key1" "value1" "key2" $OtherVar -}}

Adding a key/value pair:

{{- $_0 := set $ExampleDict "key2" "value3" -}}
{{- $_1 := set $ExampleDict "SomeList" (list "a" "b" "c") -}}