karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.12k stars 807 forks source link

when controller return error is non-nil not need to set Result.Requeue #4795

Closed yanfeng1992 closed 1 month ago

yanfeng1992 commented 1 month ago

Signed-off-by: huangyanfeng huangyanfeng1992@gmail.com

What type of PR is this? /kind cleanup

What this PR does / why we need it:

The Controller will requeue the Request to be processed again if an error is non-nil or Result.Requeue is true, an error is non-nil has higher priority. Therefore, there is no need to set Result.Requeue to true when the error is non-nil.

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE
XiShanYongYe-Chang commented 1 month ago

Thanks @yanfeng1992, I've actually had a partial cleanup before. /assign

A ut has been failed, can you help fix it?

codecov-commenter commented 1 month ago

Codecov Report

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

Project coverage is 51.75%. Comparing base (a0c0a98) to head (7c2b3e1).

Files Patch % Lines
...ers/binding/cluster_resource_binding_controller.go 0.00% 6 Missing :warning:
pkg/controllers/binding/binding_controller.go 16.66% 5 Missing :warning:
...ionfailover/crb_application_failover_controller.go 0.00% 2 Missing :warning:
...tionfailover/rb_application_failover_controller.go 0.00% 2 Missing :warning:
...acefuleviction/crb_graceful_eviction_controller.go 0.00% 2 Missing :warning:
...racefuleviction/rb_graceful_eviction_controller.go 0.00% 2 Missing :warning:
...kg/controllers/status/cluster_status_controller.go 33.33% 2 Missing :warning:
pkg/controllers/status/crb_status_controller.go 0.00% 2 Missing :warning:
pkg/controllers/status/rb_status_controller.go 0.00% 2 Missing :warning:
pkg/controllers/status/work_status_controller.go 60.00% 2 Missing :warning:
... and 1 more

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4795 +/- ## ======================================= Coverage 51.75% 51.75% ======================================= Files 250 250 Lines 24980 24980 ======================================= + Hits 12928 12929 +1 + Misses 11342 11341 -1 Partials 710 710 ``` | [Flag](https://app.codecov.io/gh/karmada-io/karmada/pull/4795/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/karmada-io/karmada/pull/4795/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io) | `51.75% <14.70%> (+<0.01%)` | :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=karmada-io#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.

yanfeng1992 commented 1 month ago

Thanks @yanfeng1992, I've actually had a partial cleanup before. /assign

A ut has been failed, can you help fix it?

already fixed it @XiShanYongYe-Chang

karmada-bot commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: XiShanYongYe-Chang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[pkg/controllers/OWNERS](https://github.com/karmada-io/karmada/blob/master/pkg/controllers/OWNERS)~~ [XiShanYongYe-Chang] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment