mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-31 22:59:34 +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)
|
||||
defer cancel()
|
||||
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.RetryPeriod+le.config.RenewDeadline)
|
||||
timeoutCtx, timeoutCancel := context.WithTimeout(ctx, le.config.RenewDeadline)
|
||||
defer timeoutCancel()
|
||||
err := wait.PollUntil(le.config.RetryPeriod, func() (bool, error) {
|
||||
err := wait.PollImmediateUntil(le.config.RetryPeriod, func() (bool, error) {
|
||||
return le.tryAcquireOrRenew(), nil
|
||||
}, timeoutCtx.Done())
|
||||
le.maybeReportTransition()
|
||||
|
Reference in New Issue
Block a user