Merge pull request #98889 from jkaniuk/leaderelection-simplify

Simplify leader election code
This commit is contained in:
Kubernetes Prow Robot 2021-02-09 07:50:49 -08:00 committed by GitHub
commit 93d288e2a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,7 +151,7 @@ func New(lockType string, ns string, name string, coreClient corev1.CoreV1Interf
func NewFromKubeconfig(lockType string, ns string, name string, rlc ResourceLockConfig, kubeconfig *restclient.Config, renewDeadline time.Duration) (Interface, error) {
// shallow copy, do not modify the kubeconfig
config := *kubeconfig
timeout := ((renewDeadline / time.Millisecond) / 2) * time.Millisecond
timeout := renewDeadline / 2
if timeout < time.Second {
timeout = time.Second
}