Gomplate integration
Well, this PR was opened much earlier than intended due to my mistake; I accidentally opened it against the source repo instead of my fork 😓.
This PR proposes a solution to https://github.com/coreos/butane/issues/111, as envsubst may not be sufficient for all users.
This PR makes butane use gomplate as a templating engine, each file butane wants to open is passed through gomplate first.
Gomplate is configurable by having a .gomplate.yaml file in the current directory, no flags are used to configure gomplate (for CLI simplicity).
Disclaimer: This is my first time working with Go. I'm learning as I go, so things might not be perfect or fully optimized. Please be kind 🙏
Just looking at the amount of lines changed here (all the vendoring), I don't think this is a realistic path forward.
To make it easier to review/consider, please put all the vendored code in a single commit, the rest of the changes in another one.
Just looking at the amount of lines changed here (all the vendoring), I don't think this is a realistic path forward.
I believe you're talking about the whole concept of embeding gomplate, not the amount of commits I had 😓 ?
To make it easier to review/consider, please put all the vendored code in a single commit, the rest of the changes in another one.
Done, the PR has now 3 commits
- fix a small typo: an extra
)in the license comment - installing and vendoring everything
- the actual implementation
Thanks for your time and the review!
Note: I didn't add the license on the newly created files for now, I'll add it once you're ok with what I did 😉
Edit:
- Do you want me to ping you upon updates/messages?
- I thing I found a way to get all the config settings applied to this implementation (currently missing experimental support amongst others), the core idea of the PR won't change, but some implementation details might
Was able to add support for the Experimental mode (and simplify implementation),
Appart from the Input and Output class configurations which are incompatible with butane,
I'm still missing
Plugins
PostExec
PluginTimeout
ExecPipe
I don't think ExecPipe or PostExec should be used, so only Plugins are missing assuming they're wanted.
Will look into it asap, still code is reviewable now 😉
Edit: Plugins also done, was easier than I thought