kairos icon indicating copy to clipboard operation
kairos copied to clipboard

DRY the validator

Open mauromorales opened this issue 2 months ago • 1 comments

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

mauromorales avatar May 07 '24 07:05 mauromorales