migrators

package
Version: v0.0.0-...-bb0df7c Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InProcessMigrator

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

InProcessMigrator runs migration in-process using paging.

func NewInProcessMigrator

func NewInProcessMigrator(dynamicClient dynamic.Interface, discoveryClient discovery.ServerResourcesInterface) *InProcessMigrator

func (*InProcessMigrator) AddEventHandler

func (m *InProcessMigrator) AddEventHandler(handler cache.ResourceEventHandler)

func (*InProcessMigrator) EnsureMigration

func (m *InProcessMigrator) EnsureMigration(gr schema.GroupResource, writeKey string) (finished bool, result error, ts time.Time, err error)

func (*InProcessMigrator) HasSynced

func (m *InProcessMigrator) HasSynced() bool

func (*InProcessMigrator) PruneMigration

func (m *InProcessMigrator) PruneMigration(gr schema.GroupResource) error

type KubeStorageVersionMigrator

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

KubeStorageVersionMigrator runs migration through the kube-storage-version-migrator components, driven by CustomResources.

func (*KubeStorageVersionMigrator) AddEventHandler

func (m *KubeStorageVersionMigrator) AddEventHandler(handler cache.ResourceEventHandler)

func (*KubeStorageVersionMigrator) EnsureMigration

func (m *KubeStorageVersionMigrator) EnsureMigration(gr schema.GroupResource, writeKey string) (finished bool, result error, ts time.Time, err error)

func (*KubeStorageVersionMigrator) HasSynced

func (m *KubeStorageVersionMigrator) HasSynced() bool

func (*KubeStorageVersionMigrator) PruneMigration

func (m *KubeStorageVersionMigrator) PruneMigration(gr schema.GroupResource) error

type Migrator

type Migrator interface {
	// EnsureMigration starts a migration if it does not exist. If a migration of
	// the same write-key exists and is finished (with or without error), nothing happens.
	// If a migration of another key exists, that migration is deleted first before
	// starting a new one. This function is idem-potent as long as a running or finished
	// migration is not pruned.
	// If finished is true, result is the result of the migration, with nil meaning that it
	// finished successfully. The timestamp shows when it has been finished.
	EnsureMigration(gr schema.GroupResource, writeKey string) (finished bool, result error, ts time.Time, err error)
	// PruneMigration removes a migration, independently whether it is running or finished,
	// with error or not. If there is no migration, this must not return an error.
	PruneMigration(gr schema.GroupResource) error

	factory.Informer
}

Migrator is a resource migration mechanism.

Jump to

Keyboard shortcuts

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