Inside the template I have a fragment like this:
props: {{- toYaml .Values.myApp.container.props }}
currently props contains 4 children:
...
container:
props:
a: ...
b: ...
c: ...
d: ...
But I want to exclude c on the fly. Is there way to do it ?
Helm includes a function on dictionaries called omit.
The omit function is similar to pick, except it returns a new dict with all the keys that do not match the given keys. Example:
$myDict := dict "name1" "value1" "name2" "value2" "name3" "value 3" $new := omit $myDict "name1" "name3"The above returns
{name2: value2}
In your case this would mean:
props: {{ omit .Values.myApp.container.props "c" | toYaml }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With