Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Refactor enki build-uki command #224

Closed
wants to merge 2 commits into from

Conversation

jimmykarily
Copy link
Contributor

so that it can be used as a library from Auroraboot as part of kairos-io/kairos#1633

The following anti-patterns make it very hard to re-use the enki functions:

  • viper is used as a global store, randomly accessing everything from anywhere
  • we pass around too many "configs": the BuildConfig, the embedded kairos-agent config, the BuildUKIAction (which is essentially yet another config),

It's nearly impossible to construct the proper input for any function because we don't know what part of the configs available, is actually needed and used.

This is a first refactoring that should at least let the caller use the BuildUKIAction without needing to populate a global "viper" object.

so that it can be used as a library from Auroraboot
as part of kairos-io/kairos#1633

The following anti-patterns make it very hard to re-use the enki
functions:

- viper is used as a global store, randomly accessing everything from anywhere
- we pass around too many "configs": the BuildConfig, the embedded
  kairos-agent config, the BuildUKIAction (which is essentially yet another config),

It's nearly impossible to construct the proper input for any function
because we don't know what part of the configs available, is actually needed
and used.

This is a first refactoring that should at least let the caller use the
BuildUKIAction without needing to populate a global "viper" object.

Signed-off-by: Dimitris Karakasilis <[email protected]>
@jimmykarily
Copy link
Contributor Author

I hate this so much. enki was not built to be used as a library and looking at how many changes are need to make this possible, I wonder if it's better if I just re-implement this in Auroraboot (using snippets of code were possible from enki) without trying to use enki at all. We can then archive the enki repo altogether and use Auroraboot as a library if we ever need to. Hopefully the re-implementation will be more re-usable.

There are 10 cans of worms in front of me and I don't know which one to open :D.

image

@jimmykarily
Copy link
Contributor Author

We simply copied over the code instead: kairos-io/AuroraBoot#92
enki will be archived soon so no need to refactor. We will do the refactoring on the auroraboot side.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant