Skip to content

Commit cb2055b

Browse files
feat: bookmark and error response should be skipped in yurthub filter (#1868) (#1953)
Signed-off-by: HF <[email protected]> (cherry picked from commit 286a43e) Co-authored-by: HF <[email protected]>
1 parent a53a13e commit cb2055b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pkg/yurthub/filter/filter.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,12 @@ func (frc *filterReadCloser) StreamResponseFilter(rc io.ReadCloser, ch chan *byt
238238
return err
239239
}
240240

241-
newObj := frc.objectFilter.Filter(obj, frc.stopCh)
242-
if yurtutil.IsNil(newObj) {
243-
continue
241+
newObj := obj
242+
// BOOKMARK and ERROR response are unnecessary to filter
243+
if !(watchType == watch.Bookmark || watchType == watch.Error) {
244+
if newObj = frc.objectFilter.Filter(obj, frc.stopCh); yurtutil.IsNil(newObj) {
245+
continue
246+
}
244247
}
245248

246249
wEvent := watch.Event{

0 commit comments

Comments
 (0)