MCPcopy
hub / github.com/kubernetes/client-go / Until

Function Until

tools/watch/until.go:108–115  ·  view source on GitHub ↗

Until wraps the watcherClient's watch function with RetryWatcher making sure that watcher gets restarted in case of errors. The initialResourceVersion will be given to watch method when first called. It shall not be "" or "0" given the underlying WATCH call issues (#74022). If you want the initial l

(ctx context.Context, initialResourceVersion string, watcherClient cache.Watcher, conditions ...ConditionFunc)

Source from the content-addressed store, hash-verified

106// those items. In normal code you should care about being level driven so you'd not care about not seeing all the edges.)
107// The most frequent usage for Until would be a test where you want to verify exact order of events ("edges").
108func Until(ctx context.Context, initialResourceVersion string, watcherClient cache.Watcher, conditions ...ConditionFunc) (*watch.Event, error) {
109 w, err := NewRetryWatcher(initialResourceVersion, watcherClient)
110 if err != nil {
111 return nil, err
112 }
113
114 return UntilWithoutRetry(ctx, w, conditions...)
115}
116
117// UntilWithSync creates an informer from lw, optionally checks precondition when the store is synced,
118// and watches the output until each provided condition succeeds, in a way that is identical

Callers 1

ListWatchUntilFunction · 0.85

Calls 2

NewRetryWatcherFunction · 0.85
UntilWithoutRetryFunction · 0.85

Tested by

no test coverage detected