From 9a10e95f6eda51c6713eb6c0839a8744271140de Mon Sep 17 00:00:00 2001 From: Hongchao Deng Date: Fri, 15 Jan 2016 18:19:19 -0800 Subject: [PATCH] docs: Reflector ListAndWatch --- pkg/client/cache/reflector.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/client/cache/reflector.go b/pkg/client/cache/reflector.go index 49b007fe7eb..3bf215bb719 100644 --- a/pkg/client/cache/reflector.go +++ b/pkg/client/cache/reflector.go @@ -222,7 +222,9 @@ func (r *Reflector) canForceResyncNow() bool { return r.now().Add(forceResyncThreshold).After(r.nextResync) } -// Returns error if ListAndWatch didn't even tried to initialize watch. +// ListAndWatch first lists all items and get the resource version at the moment of call, +// and then use the resource version to watch. +// It returns error if ListAndWatch didn't even try to initialize watch. func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { var resourceVersion string resyncCh, cleanup := r.resyncChan()