Helmize
GitHub Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto mode Back to homepage

Data

Example https://github.com/buttahtoast/helmize/tree/main/examples/data

Data is shared over a specific field across all files. Data can originate from Conditions or you can manipulate the data to a certain extend.

Manipulate

With Data manipulation you can potentialy break the entire functionality. Make sure to only manipulate values under $.Data and be aware of what you are doing.

You can manipulate data from files into the shared file store, since the set and unset execute on the interface and do not return a result. Such operations can be done in files with don’t have any content at all and no matching id, since the given context which templates the file is target by those operations.

Inject

This way you add data, which will be available for all the following files:

{{- $_ := set $.data "inject" (dict "msg" "inject data into shared data store") -}}

Overwrite

Seting data which originates from condition data will only overwrite it for the current file (All YAMLs within that file). For the next file the condition data is newly merged and therefor present again.

Overwrite the key layer1.overwrite

{{- $_ := set $.data.layer_1 "overwrite" "Not Overwritten by Layer2" -}}

The layer1.overwrite will not be overwritten in the result.

Unset

Unseting data which originates from condition data will only unset it for the current file (All YAMLs within that file). For the next file the condition data is newly merged and therefor present again.

Unsets the data key unwated and layer1.

{{- $_ := unset $.data "unwanted" -}}
{{- $_ := unset $.data "layer1" -}}

The unwanted key will no longer be present, the layer1 will be present, since it’s from the layer1 condition.