Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultExponentialBackoff = wait.Backoff{ Duration: 5 * time.Second, Factor: 1.5, Jitter: 1.0, Steps: 12, }
DefaultExponentialBackoff is the default backoff strategy that is used for doing an exponential backoff. This configuration results into a total wait time of 20 minutes
Functions ¶
func NewExponentialBackoffOps ¶
func NewExponentialBackoffOps( cloudOps cloudops.Ops, errorCheck ExponentialBackoffErrorCheck, backoff wait.Backoff, ) cloudops.Ops
NewExponentialBackoffOps return wrapper for CloudOps interface for all cloud providers. It provides exponential backoff retries on cloud APIs for specific error codes It uses k8s.io/apimachinery's wait.ExponentialBackoff
ExponentialBackoff repeats a condition check with exponential backoff.
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 condition never returns true, ErrWaitTimeout is returned. All other errors terminate immediately.
Types ¶
type ExponentialBackoffErrorCheck ¶
ExponentialBackoffErrorCheck is a callback function implemented by cloud providers which process the input error and indicate if an exponential backoff is required