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 ?
Try:
{{ $myProps := .Values.myApp.container.props }}
{{ $_ := unset $myProps "c" }}
Then you can use it, for example:
props: {{ $myProps | toYaml | nindent 2 }}
which leads to:
props:
a: 1
b: 2
d: 4