package fake

import "sigs.k8s.io/controller-runtime/pkg/leaderelection/fake"

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

Index

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 ResourceLock

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

ResourceLock implements the ResourceLockInterface. By default returns that the current identity holds the lock.

func (*ResourceLock) Create

Create implements the ResourceLockInterface.

func (*ResourceLock) Describe

func (f *ResourceLock) Describe() string

Describe implements the ResourceLockInterface.

func (*ResourceLock) Get

Get implements the ResourceLockInterface.

func (*ResourceLock) Identity

func (f *ResourceLock) Identity() string

Identity implements the ResourceLockInterface.

func (*ResourceLock) RecordEvent

func (f *ResourceLock) RecordEvent(s string)

RecordEvent implements the ResourceLockInterface.

func (*ResourceLock) Update

Update implements the ResourceLockInterface.

Source Files

doc.go leader_election.go

Version
v0.20.4 (latest)
Published
Mar 24, 2025
Platform
linux/amd64
Imports
10 packages
Last checked
2 days ago

Tools for package owners.