Files
client-go/tools
aimuz 4379fade33 leaderelection: replace deprecated wait.PollImmediateUntil with wait.PollUntilContextTimeout
This commit refactors the `renew` function in the leader election package to replace
the deprecated `wait.PollImmediateUntil` with `wait.PollUntilContextTimeout`.
This change simplifies the context handling by removing the need for an additional
timeout context and its cancellation.

The previous implementation created a timeout context for each retry period,
which added unnecessary complexity. The new implementation directly passes the parent
context to the retry function, ensuring that the timeout is handled within `PollUntilContextTimeout`.

This change also ensures that the context passed to `tryAcquireOrRenew` and
`tryCoordinatedRenew` is consistent, improving the readability and maintainability of the code.

Kubernetes-commit: 3d2f498aa31cb2e90bcfc372b7930aed0604fbef
2024-08-30 19:25:45 +08:00
..
2023-02-28 21:22:40 +01:00