Based on this feedback from the community, https://cloud-native.slack.com/archives/C07DN0D1UCW/p1749831841832469, we need to better explain what are the inputs of a patch template to speed up the process of creating custom patch templates.
Otherwise, users need to hack to understand what are their options:
Create a template like this:
{{ $input := . }}
{{ range $name, $spec := .Workloads }}
{{ $annotations := dig "metadata" "annotations" dict $spec }}
{{ range $cname, $_ := $spec.containers }}
- op: set
path: services.{{ $name }}-{{ $cname }}.labels.debug
value: {{ $input | toJson | b64enc }}
{{ end }}
{{ end }}
Now I can grab the base64 input object coming into the template rendering, convert from base64 back to json
Then use https://gotemplate.io/ (which appears to have support for sprig functions) and iterate there on the template
The goal will be to update both pages accordingly:
Based on this feedback from the community, https://cloud-native.slack.com/archives/C07DN0D1UCW/p1749831841832469, we need to better explain what are the inputs of a patch template to speed up the process of creating custom patch templates.
Otherwise, users need to hack to understand what are their options:
The goal will be to update both pages accordingly: