carvel-dev / ytt

YAML templating tool that works on YAML structure instead of text
https://carvel.dev/ytt
Apache License 2.0
1.68k stars 137 forks source link

Can an overlay change a function definition? #922

Open scastria opened 4 months ago

scastria commented 4 months ago

Suppose I had a yml file that declared a function that is called throughout that yml file. Can I add an overlay that redefines that function to have different content?

prembhaskal commented 4 months ago

I think it cannot. If you see here https://carvel.dev/ytt/docs/v0.49.x/how-it-works/ , overlay works on top of evaluated templates. Evaluated templates cannot have function definition because ytt does not emit comments, and all functions are defined as comments.

renuy commented 4 months ago

@scastria for ytt clarifications, you can also reach out on #carvel in Kubernetes Slack