mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-04 08:35:10 +00:00
Use context.TODO() to be explicit that cancellation is not implemented
Kubernetes-commit: 102090d1f12f9b00571d440470ba040e0632fbe0
This commit is contained in:
committed by
Kubernetes Publisher
parent
ad39df114e
commit
f674595347
@@ -208,10 +208,9 @@ func (le *LeaderElector) renew(ctx context.Context) {
|
|||||||
ctx, cancel := context.WithCancel(ctx)
|
ctx, cancel := context.WithCancel(ctx)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
wait.Until(func() {
|
wait.Until(func() {
|
||||||
// PollUntil() sleeps for "interval" duration before calling the function so we need to increase the timeout by le.config.RetryPeriod
|
timeoutCtx, timeoutCancel := context.WithTimeout(ctx, le.config.RenewDeadline)
|
||||||
timeoutCtx, timeoutCancel := context.WithTimeout(ctx, le.config.RetryPeriod+le.config.RenewDeadline)
|
|
||||||
defer timeoutCancel()
|
defer timeoutCancel()
|
||||||
err := wait.PollUntil(le.config.RetryPeriod, func() (bool, error) {
|
err := wait.PollImmediateUntil(le.config.RetryPeriod, func() (bool, error) {
|
||||||
return le.tryAcquireOrRenew(), nil
|
return le.tryAcquireOrRenew(), nil
|
||||||
}, timeoutCtx.Done())
|
}, timeoutCtx.Done())
|
||||||
le.maybeReportTransition()
|
le.maybeReportTransition()
|
||||||
|
Reference in New Issue
Block a user