leaderelection

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ErrNotLeader constable.Error = "write attempt rejected as client is not leader"

Variables

This section is empty.

Functions

func New

New returns a client that has a leader election middleware injected into it. This middleware will prevent all non-read requests to the Kubernetes API when the current process does not hold the leader election lock. Unlike normal leader election where the process blocks until it acquires the lock, this middleware approach lets the process run as normal for all read requests. Another difference is that if the process acquires the lock and then loses it (i.e. a failed renewal), it will not exit (i.e. restart). Instead, it will simply attempt to acquire the lock again.

The returned function is blocking and will run the leader election polling logic and will coordinate lease release with the input controller starter function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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