Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add toYaml/fromYaml functions #358

Open
alexbde opened this issue Jan 20, 2023 · 3 comments · Fixed by go-sprout/sprout#36 · May be fixed by #360
Open

Feature request: add toYaml/fromYaml functions #358

alexbde opened this issue Jan 20, 2023 · 3 comments · Fixed by go-sprout/sprout#36 · May be fixed by #360

Comments

@alexbde
Copy link

alexbde commented Jan 20, 2023

Experiencing the sprig library as a great tool set so far, I was a bit surprised there are no toYaml/fromYaml functions in here. It would be great to have them analogous to the Helm implementation.

I'm not a go developer, but I could try to create a PR similar to #223 if you feel comfortable with the general idea of adding toYaml/fromYaml functions :)

blakepettersson added a commit to blakepettersson/sprig that referenced this issue Feb 7, 2023
In the same vein of Masterminds#223, add YAML conversion functions. Fixes Masterminds#358.
@blakepettersson blakepettersson linked a pull request Feb 7, 2023 that will close this issue
@yebolenko
Copy link

any update on this?

27149chen added a commit to jibutech/sprig that referenced this issue May 16, 2023
* feat: add yaml to/from functions

In the same vein of Masterminds#223, add YAML conversion functions. Fixes Masterminds#358.

* chore: bump yaml version to v3

---------

Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com>
@yebolenko
Copy link

any update on this ? many developer are waiting for this feature.

42atomys added a commit to go-sprout/sprout that referenced this issue May 16, 2024
## 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
- Add `fromYaml` function to convert yaml string into a go map
- Add `toYaml` function to convert any to a yaml string
- Add `mustFromYaml` function to convert and return error to the
template system when occurs
- Add `mustToYaml` function to convert and return error to the template
system when occurs

## Fixes Masterminds#358
Masterminds#360

## Checklist
- [x] I have read the **CONTRIBUTING.md** document.
- [x] My code follows the code style of this project.
- [x] I have added tests to cover my changes.
- [x] All new and existing tests passed.
- [ ] I have updated the documentation accordingly.
- [x] This change requires a change to the documentation on the website.

## 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
@42atomys
Copy link

42atomys commented May 16, 2024

Hello everyone 👋,

I wanted to let you know that this issue has been addressed in the fork of this project at go-sprout/sprout. The fix has been implemented starting from version v0.4.0.

For those looking for a solution, I recommend checking out the latest releases of the fork. This should help address the issue discussed in this thread.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants