Closed 42atomys closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Files | Coverage Δ | |
---|---|---|
encoding_functions.go | 100.0% <100.0%> (ø) |
|
sprout.go | 100.0% <100.0%> (ø) |
Does this PR actually need sigs.k8s.io/yaml or rather gopkg.in/yaml.v3? Seems the dependency tree could be reduced a little but by removing k8s.
Description
We continue to backport features, bug fixes, and more from Sprig to Sprout. This time, I'm focusing on the YAML functions part, used by Helm and intended for use by others as well.
Changes
fromYaml
function to convert yaml string into a go maptoYaml
function to convert any to a yaml stringmustFromYaml
function to convert and return error to the template system when occursmustToYaml
function to convert and return error to the template system when occursFixes https://github.com/Masterminds/sprig/issues/358 https://github.com/Masterminds/sprig/pull/360
Checklist
Additional Information
The documentation for the encoding part of the library will be released soon after this pull request on https://sprout.atom.codes
Initially implemented by @blakepettersson on sprig