migrator

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvDisableMigration contains the name of the environment variable which can be used
	// to disable migration
	EnvDisableMigration = "MIGRATOR_DISABLE_MIGRATION"
	// EnvConfigMapName contains the name of the environment variable which can be used
	// to specify the ConfigMap name containing the configuration to migrate from
	EnvConfigMapName = "CONFIGMAP_NAME"
	// EnvConfigMapNamespace contains the name of the environment variable which can be used
	// to specify the namespace of the ConfigMap containing the configuration to migrate from
	EnvConfigMapNamespace = "CONFIGMAP_NAMESPACE"
	// DefaultConfigMapName is the default ConfigMap name used to read the configuration to
	// migrate from
	DefaultConfigMapName = "nvidia-k8s-ipam-config"
)

Variables

This section is empty.

Functions

func Migrate

func Migrate(ctx context.Context, logger logr.Logger, c client.Client, poolNamespace string) error

Migrate reads the ConfigMap with the IPAM configuration, reads the allocations from the Nodes annotation, create IPPool CRs and delete the ConfigMap and annotations

Types

type Migrator

type Migrator struct {
	K8sClient        client.Client
	IPPoolsNamespace string
	MigrationCh      chan struct{}
	LeaderElection   bool
	Logger           logr.Logger
}

Migrator migrate from CM config to IPPool CR

func (*Migrator) NeedLeaderElection

func (m *Migrator) NeedLeaderElection() bool

Implements manager.NeedLeaderElection

func (*Migrator) Start

func (m *Migrator) Start(ctx context.Context) error

Implements manager.Runnable

Jump to

Keyboard shortcuts

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