-
Notifications
You must be signed in to change notification settings - Fork 263
Support providing and translating Butane configs via library #2117
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
base: main
Are you sure you want to change the base?
Conversation
This change allows users to specify Butane configs [1] [2] directly to their instances on startup instead of an Ignition config. Many users already store their configs in Butane format and Butane provides some "sugar" for making it easier to generate Ignition specification configs. Some of this "sugar" is distro agnostic and some of it is distro specific. Implementing this means that users don't have to separately convert their Butane YAML configs into Ignition JSON configs via the `butane` CLI tool. This has the benefit of being easier for new users to understand and also the benefit of not having to have intermediate formats be either generated out of band at runtime OR stored in version control. It has the drawback, though, of allowing users to provide a configuration to their instance that is invalid and could have been detected earlier. After six years of experience in this space I believe the tradeoffs mentioned above are worth making a change like this. [1] https://coreos.github.io/butane/ [2] https://github.com/coreos/butane
Via the commands: ``` go get github.com/coreos/butane/config go get github.com/coreos/butane/config/common go mod vendor ```
bdc99d2 to
ddc646e
Compare
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.
Code Review
This pull request adds support for directly parsing Butane configs by attempting to translate them to Ignition configs if the initial Ignition parse fails. This is a great feature for user convenience. The implementation correctly adds the butane dependency and modifies the Parse function to handle both formats.
My review focuses on the new parsing logic in config/config.go. I've found a potential issue where reports containing warnings from the Butane translation step could be lost, and I've suggested a fix to ensure all diagnostics are preserved and reported to the user. This will improve the robustness of the new feature.
|
This is a proof of concept intended to generate discussion. There is a related CoreOS tracker issue where discussion is taking place and also a demo of what this looks like in a blog post I did earlier this week: |
|
One drawback of this approach is it introduces a circular dependency between Ignition and Butane, which isn't great, but I was really surprised at how little code it took to actually get a PoC that does almost everything I wanted. |
|
Are these lint errors expected? |
This change allows users to specify Butane configs [1] [2] directly
to their instances on startup instead of an Ignition config.
Many users already store their configs in Butane format and Butane
provides some "sugar" for making it easier to generate Ignition
specification configs. Some of this "sugar" is distro agnostic and
some of it is distro specific.
Implementing this means that users don't have to separately convert
their Butane YAML configs into Ignition JSON configs via the
butaneCLI tool. This has the benefit of being easier for new users to
understand and also the benefit of not having to have intermediate
formats be either generated out of band at runtime OR stored in
version control. It has the drawback, though, of allowing users to
provide a configuration to their instance that is invalid and could
have been detected earlier.
After six years of experience in this space I believe the tradeoffs
mentioned above are worth making a change like this.
[1] https://coreos.github.io/butane/
[2] https://github.com/coreos/butane