Reproducible configurations #1191
Replies: 2 comments
-
I agree that it can be hard to track where settings came from. We merge configs using an external library. If we want to keep track of what overwrites what, we need a custom implementation. On the other hand, allowing the user to generate configuration in a complex way, doesn't mean it's good practice if they do. It's rarely justified to have configuration spread in every possible source (remote config_urls, multiple files, cmdline, etc). Usually just a couple of them should be used. If the user goes down the path of complex configuration, then no auditing can save them from lost hours in debugging. Maybe a middle ground could be to store the final applicable configuration somewhere. The user can inspect that and if it's not what they expected, they can dig deeper. |
Beta Was this translation helpful? Give feedback.
-
Viper can help with this as it allows to set a fairly complex config merge order
There is currently a state yaml saved with info about the installation done by elemental here: https://github.com/kairos-io/elemental-cli/blob/main/pkg/action/install.go#L46 Maybe it could be extended to store more stuff like that and act like a source of truth, with a md5sum together to verify that it hasnt been tampered with (althougth the md5sum is kind of pointless as if you are able to modify the state yaml,you are able modify the md5sum) |
Beta Was this translation helpful? Give feedback.
-
After working a bit with the packages config, collector and schema. I think it would be a good idea to have reproducible configurations.
Right now, a system can have multiple sources for configuration. They can be part of one or multiple yaml files, cli flags, bootcmd attributes and urls for external configurations. All of these get merged together into a final yaml config which then gets validated. This obviously works well but can be a bit challenging when debugging or trying to understand the state in which the system is vs the one it should be.
Examples:
config_a
pointed toconfig_b
which pointed toconfig_c
and this is how each of them altered the system.a.yaml
and fileb.yaml
in one of the config directories. Whatever is onb.yaml
will overwrite what is ona.yaml
. This is an architectural decision and not a problem, but I do think the user should be aware of this, and be able to see somewhere why things ended up the way they ended. I think it would be nice to have some way of saying, certain attribute was originally set bya.yaml
and then overwritten byb.yaml
. And I should be able to kind of follow step by step such changes.My proposal would be to continue the refactoring of the config, so that such configurations can be properly audited, atomic and reproducible, but would like your input to see if you have more ideas on how to further improve this or if on the other hand you think this would be over engineering the system. So please chime in and share your thoughts :)
Beta Was this translation helpful? Give feedback.
All reactions