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) (#1953)

Signed-off-by: HF <[email protected]>
(cherry picked from commit 286a43e)

Co-authored-by: HF <[email protected]>
  • Loading branch information
github-actions[bot] and crazytaxii authored Feb 20, 2024
1 parent a53a13e commit cb2055b
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
}
}

wEvent := watch.Event{
Expand Down

0 comments on commit cb2055b

Please sign in to comment.