Documentation ¶
Index ¶
- func Poll(ctx context.Context, interval, timeout time.Duration, condition ConditionFunc) error
- func PollImmediate(ctx context.Context, interval, timeout time.Duration, condition ConditionFunc) error
- func PollImmediateLog(ctx context.Context, log *zap.SugaredLogger, interval, timeout time.Duration, ...) error
- func PollLog(ctx context.Context, 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 ¶
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(ctx context.Context, 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(ctx context.Context, 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(ctx context.Context, 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.