Files
client-go/tools/leaderelection
Clayton Coleman 30b06a83d6 leaderelection: Allow leader elected code to step down on a context cancel
The current code simply exits without continuing to renew the lease, which means
participants using a slower lease duration might have to wait multiple minutes
before a new leader is elected. Allow an optional flag to be set on
LeaderElectionConfig that will release the lease when the calling context is
cancelled. Callers *must* ensure their lease guarded code has completed before
the context is cancelled, or other processes may acquire the lease before this
lease has released.

Add an example command that demonstrates how cancellation could be done.

As a convenience to users, make event recorder optional - not all users of the
lock code will need a recorder.

Kubernetes-commit: 09890b6c48da8e85237a5674d6256900f482b0a5
2018-11-27 21:51:21 -05:00
..