capicrdmigrator

package
v0.1.82 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CurrentStorageVersion = "v1beta1"
	TargetStorageVersion  = "v1beta2"

	CAPIStorageVersionEnvVar = "CAPI_STORAGE_VERSION"

	// MigrationCompleteCondition is True when all configured CRDs have been migrated.
	MigrationCompleteCondition = "MigrationComplete"
	// ProgressingCondition is True while migration is actively running.
	ProgressingCondition = "Progressing"
	// DegradedCondition is True when errors occurred during migration.
	DegradedCondition = "Degraded"
)
View Source
const (
	// CRDMigrationObservedGenerationAnnotation indicates on a CRD for which generation CRD migration is completed.
	CRDMigrationObservedGenerationAnnotation = "crd-migration.cluster.x-k8s.io/observed-generation"
)
View Source
const (
	StatusConfigMapName = "capi-migration-status"
)

Variables

This section is empty.

Functions

func RegisterMigrationMetrics

func RegisterMigrationMetrics(c client.Reader, namespace string)

Types

type ByObjectConfig

type ByObjectConfig struct {
	UseCache                            bool
	UseStatusForStorageVersionMigration bool
}

ByObjectConfig contains object-specific config for the CRD migration.

type CAPIMigrationStatus

type CAPIMigrationStatus struct {
	// Total number of CRDs configured for migration.
	TotalCRDs int `json:"totalCRDs"`
	// Number of CRDs that have completed migration (have the observed-generation annotation set).
	MigratedCRDs int                `json:"migratedCRDs"`
	Conditions   []metav1.Condition `json:"conditions,omitempty"`
}

type CRDMigrator

type CRDMigrator struct {
	Client    client.Client
	APIReader client.Reader
	Namespace string

	SkipCRDMigrationPhases []Phase

	Config map[client.Object]ByObjectConfig
	// contains filtered or unexported fields
}

CRDMigrator migrates CRDs.

func (*CRDMigrator) Reconcile

func (r *CRDMigrator) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)

func (*CRDMigrator) SetupWithManager

func (r *CRDMigrator) SetupWithManager(ctx context.Context, mgr ctrl.Manager, controllerOptions controller.Options) error

type Phase

type Phase string

Phase is a phase of the CRD migration.

var (
	// StorageVersionMigrationPhase re-writes all CRs so they are stored in the current storageVersion in etcd.
	StorageVersionMigrationPhase Phase = "StorageVersionMigration"

	// CleanupManagedFieldsPhase removes managedFields referencing API versions that are no longer served.
	CleanupManagedFieldsPhase Phase = "CleanupManagedFields"
)

type StatusReporter

type StatusReporter struct {
	// contains filtered or unexported fields
}

func NewStatusReporter

func NewStatusReporter(c client.Client, namespace string, configByCRDName map[string]ByObjectConfig) *StatusReporter

func (*StatusReporter) Reconcile

func (s *StatusReporter) Reconcile(ctx context.Context, reconcileErr error) error

func (*StatusReporter) SetCRDMigrated

func (s *StatusReporter) SetCRDMigrated(crdName string)

Jump to

Keyboard shortcuts

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