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

improve filter manager in yurthub component #1985

Closed rambohe-ch closed 5 months ago

rambohe-ch commented 5 months ago

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line: /kind bug /kind documentation /kind enhancement /kind good-first-issue /kind feature /kind question /kind design /sig ai /sig iot /sig network /sig storage

/kind enhancement

What this PR does / why we need it:

improve filter manager in yurthub component and make that it is easy to add a new filter.

Which issue(s) this PR fixes:

Fixes #1984

Special notes for your reviewer:

Does this PR introduce a user-facing change?

other Note

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.1% Duplication on New Code

See analysis details on SonarCloud

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 74.04580% with 34 lines in your changes are missing coverage. Please review.

Project coverage is 52.91%. Comparing base (273e8df) to head (b7cb6f2).

Files Patch % Lines
pkg/yurthub/filter/base/base.go 58.82% 15 Missing and 6 partials :warning:
pkg/yurthub/filter/servicetopology/filter.go 75.00% 3 Missing :warning:
pkg/yurthub/filter/discardcloudservice/filter.go 50.00% 2 Missing :warning:
pkg/yurthub/filter/inclusterconfig/filter.go 33.33% 2 Missing :warning:
pkg/yurthub/filter/masterservice/filter.go 80.00% 2 Missing :warning:
pkg/yurthub/filter/nodeportisolation/filter.go 33.33% 2 Missing :warning:
...kg/yurthub/filter/initializer/nodes_initializer.go 83.33% 0 Missing and 1 partial :warning:
pkg/yurthub/filter/responsefilter/filter.go 91.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1985 +/- ## ========================================== + Coverage 52.38% 52.91% +0.53% ========================================== Files 174 176 +2 Lines 20975 20963 -12 ========================================== + Hits 10988 11093 +105 + Misses 9039 8918 -121 - Partials 948 952 +4 ``` | [Flag](https://app.codecov.io/gh/openyurtio/openyurt/pull/1985/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openyurtio) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/openyurtio/openyurt/pull/1985/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openyurtio) | `52.91% <74.04%> (+0.53%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openyurtio#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Congrool commented 5 months ago

/lgtm

Congrool commented 5 months ago

/approve