Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request]Bookmark and error response should be skipped in yurthub filter. #1868

Closed
rambohe-ch opened this issue Dec 22, 2023 · 1 comment · Fixed by #1873
Closed
Labels
help wanted help wanted kind/feature kind/feature kind/good-first-issue kind/good-first-issue

Comments

@rambohe-ch
Copy link
Member

rambohe-ch commented Dec 22, 2023

What would you like to be added:
A built-in filter framework is included in yurthub component, and the response from kube-apiserver can go through these filters.

And response for watch request has five types as following:

Added    EventType = "ADDED"
Modified EventType = "MODIFIED"
Deleted  EventType = "DELETED"
Bookmark EventType = "BOOKMARK"
Error    EventType = "ERROR"

then for Bookmak and Error response is not needed to go through filters. so we can add a if condition to verify that filter should be executed or not as following:

if watchType == watch. Added || watchType == watch.Modified || watchType == watch.Deleted {
	newObj := frc.objectFilter.Filter(obj, frc.stopCh)
	if yurtutil.IsNil(newObj) {
		continue
	}
}

newObj := frc.objectFilter.Filter(obj, frc.stopCh)
if yurtutil.IsNil(newObj) {
continue
}

others
/kind feature

@rambohe-ch rambohe-ch added help wanted help wanted kind/good-first-issue kind/good-first-issue kind/feature kind/feature labels Dec 22, 2023
@crazytaxii
Copy link
Contributor

/assign

github-actions bot pushed a commit that referenced this issue Feb 20, 2024
rambohe-ch pushed a commit that referenced this issue Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted help wanted kind/feature kind/feature kind/good-first-issue kind/good-first-issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants