Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RetryWatcher ¶
type RetryWatcher struct {
// contains filtered or unexported fields
}
RetryWatcher will make sure that in case the underlying watcher is closed (e.g. due to API timeout or etcd timeout) it will get restarted from the last point without the consumer even knowing about it. RetryWatcher does that by inspecting events and keeping track of resourceVersion. Especially useful when using watch.UntilWithoutRetry where premature termination is causing issues and flakes. Please note that this is not resilient to etcd cache not having the resource version anymore - you would need to use Informers for that.
func NewRetryWatcher ¶
func NewRetryWatcher(initialResourceVersion string, watcherClient cache.Watcher) (*RetryWatcher, error)
NewRetryWatcher creates a new RetryWatcher. It will make sure that watches gets restarted in case of recoverable errors. The initialResourceVersion will be given to watch method when first called.
func (*RetryWatcher) Done ¶
func (rw *RetryWatcher) Done() <-chan struct{}
Done allows the caller to be notified when Retry watcher stops.
func (*RetryWatcher) IsRunning ¶
func (rw *RetryWatcher) IsRunning() bool
Done allows the caller to be notified when Retry watcher stops.
func (*RetryWatcher) ResultChan ¶
func (rw *RetryWatcher) ResultChan() <-chan watch.Event
ResultChan implements Interface.