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 ¶
Types ¶
type ByObjectConfig ¶
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) 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)
Click to show internal directories.
Click to hide internal directories.