leadermigration

package
v0.24.9-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// ControllerUnowned indicates that the controller is owned by another controller manager
	//  and thus should NOT be started by this controller manager.
	ControllerUnowned = iota
	// ControllerMigrated indicates that the controller manager should start this controller
	//  with the migration lock.
	ControllerMigrated
	// ControllerNonMigrated indicates that the controller manager should start this controller
	//  with the main lock.
	ControllerNonMigrated
)

Variables

This section is empty.

Functions

func Enabled

func Enabled(genericConfig *config.GenericControllerManagerConfiguration) bool

Enabled checks whether Leader Migration should be enabled, given the GenericControllerManagerConfiguration. It considers the feature gate first, and will always return false if the feature gate is not enabled.

func FeatureEnabled

func FeatureEnabled() bool

FeatureEnabled tells if leader migration is enabled through the feature gate.

Types

type FilterFunc

type FilterFunc func(controllerName string) FilterResult

FilterFunc takes a name of controller, returning a FilterResult indicating how to start controller.

type FilterResult

type FilterResult int32

FilterResult indicates whether and how the controller manager should start the controller.

type LeaderMigrator

type LeaderMigrator struct {
	// MigrationReady is closed after the controller manager finishes preparing for the migration lock.
	// After this point, the leader migration process will proceed to acquire the migration lock.
	MigrationReady chan struct{}

	// FilterFunc returns a FilterResult telling the controller manager what to do with the controller.
	FilterFunc FilterFunc
}

LeaderMigrator holds information required by the leader migration process.

func NewLeaderMigrator

func NewLeaderMigrator(config *internal.LeaderMigrationConfiguration, component string) *LeaderMigrator

NewLeaderMigrator creates a LeaderMigrator with given config for the given component. component

indicates which controller manager is requesting this leader migration, and it should be consistent
with the component field of ControllerLeaderConfiguration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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