File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
staging/src/k8s.io/client-go/tools/watch Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,8 @@ func (rw *RetryWatcher) send(event watch.Event) bool {
101
101
// If it is not done the second return value holds the time to wait before calling it again.
102
102
func (rw * RetryWatcher ) doReceive () (bool , time.Duration ) {
103
103
watcher , err := rw .watcherClient .Watch (metav1.ListOptions {
104
- ResourceVersion : rw .lastResourceVersion ,
104
+ ResourceVersion : rw .lastResourceVersion ,
105
+ AllowWatchBookmarks : true ,
105
106
})
106
107
// We are very unlikely to hit EOF here since we are just establishing the call,
107
108
// but it may happen that the apiserver is just shutting down (e.g. being restarted)
@@ -174,10 +175,12 @@ func (rw *RetryWatcher) doReceive() (bool, time.Duration) {
174
175
return true , 0
175
176
}
176
177
177
- // All is fine; send the event and update lastResourceVersion
178
- ok = rw .send (event )
179
- if ! ok {
180
- return true , 0
178
+ // All is fine; send the non-bookmark events and update resource version.
179
+ if event .Type != watch .Bookmark {
180
+ ok = rw .send (event )
181
+ if ! ok {
182
+ return true , 0
183
+ }
181
184
}
182
185
rw .lastResourceVersion = resourceVersion
183
186
You can’t perform that action at this time.
0 commit comments