-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add toYaml & fromYaml functions #20
Add toYaml & fromYaml functions #20
Conversation
2991437
to
07d2255
Compare
Thx, I was looking for exactly this. Without it, i believe go templates need to be aware of the input schema all the way down even to copy values from those fields (i.e. to not change them at all). |
Hi @jan-di , thanks for extending available helper functions! Can you please create a new folder under |
1e6331b
to
614e3b2
Compare
@ezgidemirel done. Please note I also added |
Could merging and releasing this get some priority? I am aware that functions are still beta feature, and there's no bug report for this (yes, I consider the lack of this a bug, not an enhancement -- should we open an bug type issue as well?). Without this, function-go-templating is very limited in usability, unfortunately. Thank you! |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jan-di for the PR! Added a small comment to fix README. Apart from that, there are some conflicts that need to be resolved. Could you please rebase your PR, so that we can merge it :)
I disagree, I think toYaml is required. Or at least I haven't figured out how to take arbitrary yaml object from claim/xr and output it to the managed resource verbatim (either as yaml or json) without knowing and defining the exact schema of the arbitrary yaml object in the go template. |
5d2d662
to
9a4169d
Compare
Signed-off-by: Jan Dittrich <[email protected]>
Signed-off-by: Jan Dittrich <[email protected]>
Signed-off-by: Jan Dittrich <[email protected]>
Co-authored-by: ezgidemirel <[email protected]> Signed-off-by: Jan Dittrich <[email protected]>
9a4169d
to
a5a9d15
Compare
Signed-off-by: Jan Dittrich <[email protected]>
Thank you for the review. From my side, everything is done and green :) |
Description of your changes
Add two functions
toYaml
andfromYaml
to this function, as they are not supported in sprig. Esepcially the first one is essential, as the templates are focused on creating yaml resources.I have:
[ ] Added or updated unit tests for my change.