Documentation ¶
Index ¶
- func Poll(interval, timeout time.Duration, condition ConditionFunc) error
- func PollImmediate(interval, timeout time.Duration, condition ConditionFunc) error
- func PollImmediateLog(log *zap.SugaredLogger, interval, timeout time.Duration, ...) error
- func PollLog(log *zap.SugaredLogger, interval, timeout time.Duration, ...) error
- type ConditionFunc
- type PollFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Poll ¶
func Poll(interval, timeout time.Duration, condition ConditionFunc) error
Poll works identically to k8swait.Poll, with the exception that a condition must return an error/nil to indicate a successful condition. In case a timeout occurs, the transient error is returned as part of the k8swait.ErrWaitTimeout, but note that the ErrWaitTimeout is being wrapped and the transient error only included as a string.
func PollImmediate ¶
func PollImmediate(interval, timeout time.Duration, condition ConditionFunc) error
PollImmediate works identically to k8swait.PollImmediate, with the exception that a condition must return an error/nil to indicate a successful condition. In case a timeout occurs, the transient error is returned as part of the k8swait.ErrWaitTimeout, but note that the ErrWaitTimeout is being wrapped and the transient error only included as a string.
func PollImmediateLog ¶
func PollImmediateLog(log *zap.SugaredLogger, interval, timeout time.Duration, condition ConditionFunc) error
PollImmediateLog is an extension of PollImmediate and will, if a transient error occurs, log that error on the INFO level using the given logger. Use this if you want continuous feedback and make sure to set a sensible interval like 5+ seconds.
func PollLog ¶
func PollLog(log *zap.SugaredLogger, interval, timeout time.Duration, condition ConditionFunc) error
PollLog is an extension of Poll and will, if a transient error occurs, log that error on the INFO level using the given logger. Use this if you want continuous feedback and make sure to set a sensible interval like 5+ seconds.