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: 12 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"
	// EnvHostLocalStorePath contains the name of the environment variable which can be used to
	// change host local IPAM store path
	EnvHostLocalStorePath = "MIGRATOR_HOST_LOCAL_STORE"
	// DefaultHostLocalStorePath contains default path for host-local store which was used
	// in the older version
	DefaultHostLocalStorePath = "/var/lib/cni/nv-ipam/state/host-local"
	// PlaceholderForUnknownField contains placeholder string which will be used as a value
	// for fields for which we have no data
	PlaceholderForUnknownField = "MIGRATED_NO_DATA"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Migrator

type Migrator interface {
	// Migrate execute migration logic.
	// The implementation will check if host-local IPAM data that were created by the previous version
	// of nv-ipam are available on the filesystem. If the data is found,
	// the migrator will read and save them into the store and then remove data in the old format.
	// Some information required by the new store schema can't be restored from the host-local IPAM store
	// format used in the older version of the nv-ipam. Missing data will be replaced by
	// a special placeholder which indicates that data is missing.
	Migrate(ctx context.Context) error
}

Migrator is the interface implemented by migrator package

func New

func New(store storePkg.Store) Migrator

New create and initialize new instance of the migrator

Jump to

Keyboard shortcuts

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