controller-runtime: sigs.k8s.io/controller-runtime/pkg/leaderelection/fake Index | Files

package fake

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

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

Index

Package Files

doc.go leader_election.go

func NewResourceLock Uses

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.

type ResourceLock Uses

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 Uses

func (f *ResourceLock) Create(ler resourcelock.LeaderElectionRecord) error

Create implements the ResourceLockInterface.

func (*ResourceLock) Describe Uses

func (f *ResourceLock) Describe() string

Describe implements the ResourceLockInterface.

func (*ResourceLock) Get Uses

func (f *ResourceLock) Get() (*resourcelock.LeaderElectionRecord, error)

Get implements the ResourceLockInterface.

func (*ResourceLock) Identity Uses

func (f *ResourceLock) Identity() string

Identity implements the ResourceLockInterface.

func (*ResourceLock) RecordEvent Uses

func (f *ResourceLock) RecordEvent(s string)

RecordEvent implements the ResourceLockInterface.

func (*ResourceLock) Update Uses

func (f *ResourceLock) Update(ler resourcelock.LeaderElectionRecord) error

Update implements the ResourceLockInterface.

Package fake imports 8 packages (graph). Updated 2019-05-05. Refresh now. Tools for package owners.