Documentation
¶
Index ¶
- Variables
- func Retry(backoff Backoff, condition func() error) error
- func RetryContined(backoff Backoff, condition func() error, continued func(error) bool) error
- func RetryIgnored(backoff Backoff, condition func() error, ignored func(error) bool) error
- func RetryOn(backoff Backoff, condition func() error, continueOn func(error) bool) errordeprecated
- type Backoff
Constants ¶
This section is empty.
Variables ¶
var DefaultBackoff = Backoff{ Steps: 4, Duration: 10 * time.Millisecond, Factor: 5.0, Jitter: 0.1, }
DefaultBackoff is the recommended backoff for a conflict where a client may be attempting to make an unrelated modification to a resource under active management by one or more controllers.
var DefaultRetry = Backoff{ Steps: 5, Duration: 10 * time.Millisecond, Factor: 1.0, Jitter: 0.1, }
DefaultRetry is the recommended retry for a conflict where multiple clients are making changes to the same resource.
var ErrWaitTimeout = wait.ErrWaitTimeout
ErrWaitTimeout is returned when the condition exited without success.
Functions ¶
func Retry ¶
Retry executes the provided condition func repeatedly, retrying with exponential backoff if the condition func returns an error.
It checks the condition up to Steps times, increasing the wait by multiplying the previous duration by Factor.
If Jitter is greater than zero, a random amount of each duration is added (between duration and duration*(1+jitter)).
If the retrying timeout, the last error of condition will be returned
func RetryContined ¶
RetryContined does the same thing with Retry() except that it will keep trying if the error returned by condition is within the expected by continued function nolint
func RetryIgnored ¶
RetryIgnored does the same thing with Retry() but it will stop retrying when conidtion returns an error which will be ignored if it is within the expected. nolint