mirror of
https://github.com/holos-run/holos.git
synced 2026-03-20 01:04:59 +00:00
Previously, the #Resources struct listing valid resources to use with APIObjects in each of the components types was closed. This made it very difficult for users to mix in new resources and use the Kubernetes component kind. This patch moves the definition of the valid resources to package holos from the schema API. The schema still enforces some light constraints, but doesn't keep the struct closed. A new convention is introduced in the form of configuring all components using _ComponentConfig defined at the root, then unifying this struct with all of the component kinds. See schema.gen.cue for how this works. This approach enables mixing in ArgoCD applications to all component kinds, not just Helm as was done previously. Similarly, the user-constrained #Resources definition unifies with all component kinds. It's OK to leave the yaml.Marshall in the schema API. The user shouldn't ever have to deal with #APIObjects, instead they should pass Resources through the schema API which will use APIObjects to create apiObjectMap for each component type and the BuildPlan. This is still more awkward than I want, but it's a good step in the right direction.