migrators

package
v0.0.0-...-0597a29 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrNotRetriable

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

ErrNotRetriable is a wrapper for an error that a migrator may use to indicate the specific error cannot be retried.

func (ErrNotRetriable) Temporary

func (ErrNotRetriable) Temporary() bool

type ErrRetriable

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

ErrRetriable is a wrapper for an error that a migrator may use to indicate the specific error can be retried.

func (ErrRetriable) Temporary

func (ErrRetriable) Temporary() bool

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) []cache.InformerSynced

func (*InProcessMigrator) EnsureMigration

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

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 (*KubeStorageVersionMigrator) EnsureMigration

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

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.
	EnsureMigration(gr schema.GroupResource, writeKey string) (finished bool, result error, 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

	// AddEventHandler registers a event handler whenever the resources change
	// that might influence the result of Migrations().
	AddEventHandler(handler cache.ResourceEventHandler) []cache.InformerSynced
}

Migrator is a resource migration mechanism.

type TemporaryError

type TemporaryError interface {
	error
	// Temporary should return true if this is a temporary error
	Temporary() bool
}

TemporaryError is a wrapper interface that is used to determine if an error can be retried.

Jump to

Keyboard shortcuts

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