fake

package
v0.22.4 Latest Latest
Warning

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

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

Documentation

Overview

Package fake mocks a resource lock for testing purposes. Always returns leadership.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResourceLock

func NewResourceLock(config *rest.Config, recorderProvider recorder.Provider, options leaderelection.Options) (resourcelock.Interface, error)

NewResourceLock creates a new ResourceLock for use in testing leader election.

Types

type ControllableResourceLockInterface added in v0.22.0

type ControllableResourceLockInterface interface {
	resourcelock.Interface

	// BlockLeaderElection blocks the leader election process when called. It will not be unblocked
	// until UnblockLeaderElection is called.
	BlockLeaderElection()

	// UnblockLeaderElection unblocks the leader election.
	UnblockLeaderElection()
}

ControllableResourceLockInterface is an interface that extends resourcelock.Interface to be controllable.

Jump to

Keyboard shortcuts

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