leaderelection

package
v0.0.0-...-2c1c132 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvoyFilterController = "aeraki-envoyfilter-controller-election"
	AllocateVIPController = "aeraki-service-entry-vip-allocation-controller-election"
)

Various locks used throughout the code

Variables

This section is empty.

Functions

This section is empty.

Types

type LeaderElection

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

LeaderElection is used for controller leader election

func NewLeaderElection

func NewLeaderElection(namespace, name, electionID string, client kubernetes.Interface) *LeaderElection

NewLeaderElection creates a new LeaderElection

func (*LeaderElection) AddRunFunction

func (l *LeaderElection) AddRunFunction(f func(stop <-chan struct{})) *LeaderElection

AddRunFunction registers a function to run when we are the leader. These will be run asynchronously. To avoid running when not a leader, functions should respect the stop channel.

func (*LeaderElection) Run

func (l *LeaderElection) Run(stop <-chan struct{})

Run will start leader election, calling all runFns when we become the leader.

Jump to

Keyboard shortcuts

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