feat: add toYaml and fromYaml to functions map
Adds toYaml and fromYaml functions from helm src
Hiya @norwoodj , can you approve my CI when you get time? Thanks
I would love to see those functions, as they were used a lot by the k8s-at-home guys in their charts (which are deprecated, so I forked some and noticed the missing functions...)
This would be amazing. There's also a PR to add this in Masterminds/sprig#360
@Nepo26 Need anything from me to move this?
Honestly, only chart examples in the example-charts folder and test cases for automated testing. Any question you may ping me.
@jasondamour Agreeing with @Nepo26, if you add an example chart that uses these, and a test case, we'll merge.
hello, this look fantastic, may I help?
I love you :-)
I can add an example and some tests, here my readme_template, to display storage class:
{{ $values := (.Files.Get "values.yaml") | fromYaml }}
## Snapshot classes
| name | resource group | incremental |
|----------|----------------|-------------|
{{- range $name, $spec := $values.volumeSnapshotClass }}
{{- range $parameterIncr := list "true" "false" }}
| {{ $name }}{{- if eq $parameterIncr "true" -}}-incr{{- end }} | {{ $parameterIncr }} | {{ $spec.parameters.resourceGroup | default "" }} |
{{- end }}
{{- end }}
This work like a charm!