openyurtio / openyurt

OpenYurt - Extending your native Kubernetes to edge(project under CNCF)
https://openyurt.io
Apache License 2.0
1.69k stars 398 forks source link

[feature request]extract list object handling from ObjectFilter to ResponseFilter #1990

Closed rambohe-ch closed 5 months ago

rambohe-ch commented 5 months ago

What would you like to be added: In each ObjectFilter(like masterservice, servicetopology, etc.), filter need to handle standalone object and List object. For example, masterservice filter need to handle *v1.ServiceList and *v1.Service as following:

https://github.com/openyurtio/openyurt/blob/acec197f3bee3348cec7d5d23d162ae3df4b3c21/pkg/yurthub/filter/masterservice/filter.go#L82-L95

And handling list object is just a collection of standalone object handling, so it is a good idea to handle list object in a common place like ResponseFilter instead of handling them in every ObjectFilter.

So i will make a pull request to improve list object handling in ObjectFilter, then ObjectFilter only need to handle standalone object(like *v1.Service).

others /kind feature