Documentation
¶
Overview ¶
Package cli holds API-server admin sub-commands. This file implements the one-shot migration that promotes Kubernetes from "render target" to source of truth for component values.
Walk every Application in Mongo, scan each environment namespace for `Component` CRDs labelled with this application, and for each CRD found either reuse the matching Mongo identity or auto-import a new one. Every CRD then gets a single v1 deployed `ComponentRevision` whose `values` match the live `Component.Spec.Values`. Legacy `Component.Values` and `Application.Revisions` fields are dropped after writes complete.
The migration is idempotent over its own progress: components that already have a v1 deployed revision in an env are not double-written.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MigrateComponentsConfig ¶
type MigrateComponentsConfig struct {
DryRun bool
}
MigrateComponentsConfig drives one execution of the migration.
type MigrationCounters ¶
type MigrationCounters struct {
Apps int
Envs int
CRDsObserved int
IdentitiesCreated int
RevisionsWritten int
RevisionsSkipped int
UnboundCRDs int
VerificationErrors []string
}
MigrationCounters reports how much work the migration did or would do.
func RunMigrateComponents ¶
func RunMigrateComponents(ctx context.Context, db *database.MongoDB, cfg MigrateComponentsConfig) (*MigrationCounters, error)
RunMigrateComponents executes the migration. Dry-run mode logs what would happen and writes nothing.