datastoremigration

package
v1.45.0-0.dev Latest Latest
Warning

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

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

Documentation

Overview

Package datastoremigration provides utilities for checking DatastoreMigration CR state from the operator's controllers.

Index

Constants

View Source
const (
	GroupName = "migration.projectcalico.org"
	Kind      = "DatastoreMigration"
	ListKind  = "DatastoreMigrationList"
	Resource  = "datastoremigrations"
)
View Source
const (
	PhasePending                      = "Pending"
	PhaseMigrating                    = "Migrating"
	PhaseWaitingForConflictResolution = "WaitingForConflictResolution"
	PhaseConverged                    = "Converged"
	PhaseComplete                     = "Complete"
	PhaseFailed                       = "Failed"
)

Phase constants for DatastoreMigration status.

Variables

View Source
var (
	// GroupVersionV1 is the GA group/version, the storage version from Calico v3.33.
	GroupVersionV1 = schema.GroupVersion{Group: GroupName, Version: "v1"}

	// GroupVersionV1beta1 is the pre-GA group/version, deprecated but still served in v3.33.
	// TODO: remove in v3.34.
	GroupVersionV1beta1 = schema.GroupVersion{Group: GroupName, Version: "v1beta1"}
)

Functions

func Exists

func Exists(c client.Client) bool

Exists returns true if at least one DatastoreMigration CR exists.

func GetPhase

func GetPhase(c client.Client) string

GetPhase returns the phase of the first DatastoreMigration CR, or empty string if none exists or the CRD is not installed.

func ServedGroupVersion

func ServedGroupVersion(disco discovery.DiscoveryInterface) (schema.GroupVersion, bool, error)

ServedGroupVersion returns the served group/version, preferring v1. The bool is false when the CRD isn't installed; a failed lookup errors.

func ServedVersion

func ServedVersion() schema.GroupVersion

ServedVersion returns the group/version the operator reads DatastoreMigration at. It is v1 until WaitForServedVersion finds out what the cluster serves.

func WaitForServedVersion

func WaitForServedVersion(ctx context.Context, disco discovery.DiscoveryInterface)

WaitForServedVersion records the served version once the CRD appears. The user installs it at migration time, so expect a wait.

func WatchObject

func WatchObject() client.Object

WatchObject returns an empty DatastoreMigration at the served version, for controllers registering a watch.

Types

This section is empty.

Jump to

Keyboard shortcuts

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