mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-22 13:17:07 +00:00
Request for bookmarks in RetryWatcher
Kubernetes-commit: 7a65760f6e914e5421b443980831b2965c6954c7
This commit is contained in:
parent
573f9163af
commit
c16c96a7f1
@ -102,6 +102,7 @@ func (rw *RetryWatcher) send(event watch.Event) bool {
|
|||||||
func (rw *RetryWatcher) doReceive() (bool, time.Duration) {
|
func (rw *RetryWatcher) doReceive() (bool, time.Duration) {
|
||||||
watcher, err := rw.watcherClient.Watch(metav1.ListOptions{
|
watcher, err := rw.watcherClient.Watch(metav1.ListOptions{
|
||||||
ResourceVersion: rw.lastResourceVersion,
|
ResourceVersion: rw.lastResourceVersion,
|
||||||
|
AllowWatchBookmarks: true,
|
||||||
})
|
})
|
||||||
// We are very unlikely to hit EOF here since we are just establishing the call,
|
// We are very unlikely to hit EOF here since we are just establishing the call,
|
||||||
// but it may happen that the apiserver is just shutting down (e.g. being restarted)
|
// but it may happen that the apiserver is just shutting down (e.g. being restarted)
|
||||||
@ -174,11 +175,13 @@ func (rw *RetryWatcher) doReceive() (bool, time.Duration) {
|
|||||||
return true, 0
|
return true, 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// All is fine; send the event and update lastResourceVersion
|
// All is fine; send the non-bookmark events and update resource version.
|
||||||
|
if event.Type != watch.Bookmark {
|
||||||
ok = rw.send(event)
|
ok = rw.send(event)
|
||||||
if !ok {
|
if !ok {
|
||||||
return true, 0
|
return true, 0
|
||||||
}
|
}
|
||||||
|
}
|
||||||
rw.lastResourceVersion = resourceVersion
|
rw.lastResourceVersion = resourceVersion
|
||||||
|
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user