cli

package
v0.0.0-...-eb864a5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL