kairos-io / kairos

:penguin: The immutable Linux meta-distribution for edge Kubernetes.
https://kairos.io
Apache License 2.0
1.01k stars 88 forks source link

DRY the validator #2539

Open mauromorales opened 2 months ago

mauromorales commented 2 months ago

There's an ongoing effort to have the validator be the single source of truth for configurations. This of course relates to the implementation to how we apply those configurations on the system. On the initial ticket https://github.com/kairos-io/kairos/issues/778 we decided to limit the scope of the project and one shortcut we decided to have back then was to not have a single source of truth because doing so required quite a big refactoring, so we introduced the validation schemas, which are somewhat on par with the config.Config, config.Install, etc. In order to make it harder to forget to change the latter, we added tests that will fail if the two structures don't have the same fields. The problem is that, we can still introduce new config structures on the implementation part and bypass the tests and validations this way.

Check if it would be possible at this point in time to have a single source of truth, or how much extra work it would take. If we could already implement https://github.com/kairos-io/kairos/issues/2538 then it would force us to always include everything on the implementation and validation but the mechanism could still feel duplicated if it stays as is. So this card would be about further steps to simplify that

ci-robbot commented 2 months ago

Hello mauromorales, thank you for bringing up this topic. The issue you mentioned has been labeled with 'question' to indicate that it needs more information or clarification to proceed. In order to help you better, could you please provide a more detailed description of the problem you're experiencing and any relevant steps to reproduce it? Additionally, please mention the versions of the artifacts you are using (e.g., programming language, Kairos version, etc.). This information will be helpful in understanding the issue and determining the next steps. Remember, this is an experimental ai bot, created by @mudler and @jimmykarily to help with triaging Github issues. If you have any further questions, feel free to ask.