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.
ResourceLock implements the ResourceLockInterface. By default returns that the current identity holds the lock.
type ResourceLock struct {
// contains filtered or unexported fields
}
func (f *ResourceLock) Create(ctx context.Context, ler resourcelock.LeaderElectionRecord) error
Create implements the ResourceLockInterface.
func (f *ResourceLock) Describe() string
Describe implements the ResourceLockInterface.
func (f *ResourceLock) Get(ctx context.Context) (*resourcelock.LeaderElectionRecord, []byte, error)
Get implements the ResourceLockInterface.
func (f *ResourceLock) Identity() string
Identity implements the ResourceLockInterface.
func (f *ResourceLock) RecordEvent(s string)
RecordEvent implements the ResourceLockInterface.
func (f *ResourceLock) Update(ctx context.Context, ler resourcelock.LeaderElectionRecord) error
Update implements the ResourceLockInterface.