openyurtio / openyurt

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

enhance: separate clients for yurt-manager #2069

Closed luc99hen closed 3 months ago

luc99hen commented 4 months ago

What type of PR is this?

/kind enhancement

What this PR does / why we need it:

Fix https://github.com/openyurtio/openyurt/pull/2051

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

other Note

codecov[bot] commented 4 months ago

Codecov Report

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

Project coverage is 56.09%. Comparing base (3713163) to head (eb6cc42). Report is 3 commits behind head on master.

Files Patch % Lines
...roller/nodelifecycle/node_life_cycle_controller.go 0.00% 4 Missing :warning:
...r/controller/yurtappset/yurt_app_set_controller.go 0.00% 4 Missing :warning:
...roller/yurtappdaemon/yurt_app_daemon_controller.go 0.00% 3 Missing :warning:
.../daemonpodupdater/daemon_pod_updater_controller.go 0.00% 2 Missing :warning:
...et/loadbalancerset/load_balancer_set_controller.go 0.00% 2 Missing :warning:
...r/raven/gatewaypickup/gateway_pickup_controller.go 0.00% 2 Missing :warning:
...publicservice/gateway_public_service_controller.go 0.00% 2 Missing :warning:
...dinator/delegatelease/delegate_lease_controller.go 0.00% 2 Missing :warning:
.../controller/csrapprover/csr_approver_controller.go 0.00% 1 Missing :warning:
...er/controller/nodebucket/node_bucket_controller.go 0.00% 1 Missing :warning:
... and 11 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2069 +/- ## ========================================== - Coverage 56.09% 56.09% -0.01% ========================================== Files 186 186 Lines 18092 18090 -2 ========================================== - Hits 10149 10147 -2 Misses 6910 6910 Partials 1033 1033 ``` | [Flag](https://app.codecov.io/gh/openyurtio/openyurt/pull/2069/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/2069/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openyurtio) | `56.09% <0.00%> (-0.01%)` | :arrow_down: | 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.

luc99hen commented 3 months ago

@rambohe-ch I have found the root cause of the blocking e2e tests are there are no permission for controller-manager's cache building process. As we know, Cache is shared among all controllers/clients in the Manager level. And the process of building Cache need the full permissions from all clients.

Therefore, in our case we can still separate the permissions for each individual client, but the base client used by yurt-manager need the full permission at the initialization stage.

luc99hen commented 3 months ago

We can create a cache for each client used by individual controllers. However, I opt against this approach due to the escalating memory footprint.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
40 New issues
0 Accepted issues

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

See analysis details on SonarCloud

rambohe-ch commented 3 months ago

/lgtm