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

Function withCounter

tools/watch/retrywatcher_test.go:57–65  ·  view source on GitHub ↗
(w cache.Watcher)

Source from the content-addressed store, hash-verified

55func (o testObject) GetResourceVersion() string { return o.resourceVersion }
56
57func withCounter(w cache.Watcher) (*uint32, cache.Watcher) {
58 var counter uint32
59 return &counter, &cache.ListWatch{
60 WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
61 atomic.AddUint32(&counter, 1)
62 return w.Watch(options)
63 },
64 }
65}
66
67func makeTestEvent(rv int) watch.Event {
68 return watch.Event{

Callers 1

TestRetryWatcherFunction · 0.85

Calls 1

WatchMethod · 0.65

Tested by

no test coverage detected