helm-docs icon indicating copy to clipboard operation
helm-docs copied to clipboard

feat: add toYaml and fromYaml to functions map

Open jasondamour opened this issue 2 years ago • 8 comments

Adds toYaml and fromYaml functions from helm src

jasondamour avatar Mar 29 '23 23:03 jasondamour

Hiya @norwoodj , can you approve my CI when you get time? Thanks

jasondamour avatar Mar 30 '23 17:03 jasondamour

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...)

johanneskastl avatar Apr 05 '23 15:04 johanneskastl

This would be amazing. There's also a PR to add this in Masterminds/sprig#360

gabe565 avatar Apr 17 '23 16:04 gabe565

@Nepo26 Need anything from me to move this?

jasondamour avatar Oct 06 '23 17:10 jasondamour

Honestly, only chart examples in the example-charts folder and test cases for automated testing. Any question you may ping me.

Nepo26 avatar Oct 11 '23 16:10 Nepo26

@jasondamour Agreeing with @Nepo26, if you add an example chart that uses these, and a test case, we'll merge.

norwoodj avatar Nov 02 '23 18:11 norwoodj

hello, this look fantastic, may I help?

ebuildy avatar Mar 28 '24 21:03 ebuildy

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!

ebuildy avatar Mar 28 '24 21:03 ebuildy