Skip to content

Commit

Permalink
feat: bookmark and error response should be skipped in yurthub filter (
Browse files Browse the repository at this point in the history
…#1868)

Signed-off-by: HF <[email protected]>
  • Loading branch information
crazytaxii committed Dec 26, 2023
1 parent 5c1dde7 commit 286a43e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/yurthub/filter/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,12 @@ func (frc *filterReadCloser) StreamResponseFilter(rc io.ReadCloser, ch chan *byt
return err
}

newObj := frc.objectFilter.Filter(obj, frc.stopCh)
if yurtutil.IsNil(newObj) {
continue
newObj := obj
// BOOKMARK and ERROR response are unnecessary to filter
if !(watchType == watch.Bookmark || watchType == watch.Error) {
if newObj = frc.objectFilter.Filter(obj, frc.stopCh); yurtutil.IsNil(newObj) {
continue

Check warning on line 245 in pkg/yurthub/filter/filter.go

View check run for this annotation

Codecov / codecov/patch

pkg/yurthub/filter/filter.go#L245

Added line #L245 was not covered by tests
}
}

wEvent := watch.Event{
Expand Down

0 comments on commit 286a43e

Please sign in to comment.