mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-04 02:57:27 +09:00
Teach the aggregated apiserver to serve application kinds in any API group registered through an ApplicationGroupDefinition, instead of hardwiring apps.cozystack.io everywhere: - config.ApplicationConfig carries the resolved group; the startup loading path (extracted into buildResourceConfig, now unit-testable) lists ApplicationGroupDefinitions next to ApplicationDefinitions and resolves each definition's group. A definition referencing an unregistered group (dangling reference) is skipped with an error log and picked up again once the group is registered; kinds must stay unique across groups because OpenAPI schema refs are keyed by kind. - RegisterDynamicTypes registers kinds in their selected group and registers each non-default group-version (meta types, priority) the way install.Install does for the default group. - The apiserver installs one APIGroupInfo per group; the default group is always installed so its static APIService stays healthy. - The REST storage derives gvr/gvk (and hence the HelmRelease application.group label and every label-selector check) from the configured group. - OpenAPI post-processors stamp each kind with its group; the v3 processor runs per group-version document and only clones the kinds of that document's group (derived from its paths). ApplicationDefinitions with no group keep today's behavior bit for bit; group pickup is restart-based via the existing config-hash rollout (no hot reload yet). Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>