karmada icon indicating copy to clipboard operation
karmada copied to clipboard

reduce useless logic to improve dependencies distributor

Open whitewindmills opened this issue 1 year ago • 19 comments

What type of PR is this? /kind feature

What this PR does / why we need it: The dependent distributor does not pay attention to deleted or deleting attached resource templates, so optimize this part of the logic.

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

whitewindmills avatar Jan 10 '24 11:01 whitewindmills

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign kevin-wangzefeng after the PR has been reviewed. You can assign the PR to them by writing /assign @kevin-wangzefeng in a comment when ready.

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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

karmada-bot avatar Jan 10 '24 11:01 karmada-bot

I don't quite understand why dependencies distributor doesn't need to be concerned about deletion events. When the attached resource template is deleted, the corresponding rb should also need to be cleaned up.

XiShanYongYe-Chang avatar Jan 12 '24 01:01 XiShanYongYe-Chang

I don't quite understand why dependencies distributor doesn't need to be concerned about deletion events. When the attached resource template is deleted, the corresponding rb should also need to be cleaned up.

Since the attached resource template is deleted, so it's resourceBinding is deleted, cleaning up makes no sense.

whitewindmills avatar Jan 12 '24 02:01 whitewindmills

Since the attached resource template is deleted, so it's resourceBinding is deleted, cleaning up makes no sense.

Are you referring to the gc controller responsible for cleaning up the resource bindings of the resource template?

XiShanYongYe-Chang avatar Jan 12 '24 03:01 XiShanYongYe-Chang

Are you referring to the gc controller responsible for cleaning up the resource bindings of the resource template?

sure

whitewindmills avatar Jan 12 '24 03:01 whitewindmills

Thanks, I get it. Can you help add some comments on the event handler to explain why we don't need to care about this?

XiShanYongYe-Chang avatar Jan 12 '24 03:01 XiShanYongYe-Chang

Can you help add some comments on the event handler to explain why we don't need to care about this?

okay

whitewindmills avatar Jan 12 '24 03:01 whitewindmills

/cc @chaunceyjiang /assign

XiShanYongYe-Chang avatar Jan 12 '24 03:01 XiShanYongYe-Chang

Codecov Report

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

Project coverage is 53.26%. Comparing base (81acb31) to head (b30e537).

Files Patch % Lines
...ependenciesdistributor/dependencies_distributor.go 26.66% 20 Missing and 2 partials :warning:

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4532      +/-   ##
==========================================
- Coverage   53.29%   53.26%   -0.03%     
==========================================
  Files         252      252              
  Lines       20495    20508      +13     
==========================================
+ Hits        10922    10924       +2     
- Misses       8851     8861      +10     
- Partials      722      723       +1     
Flag Coverage Δ
unittests 53.26% <26.66%> (-0.03%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

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

codecov-commenter avatar Jan 12 '24 04:01 codecov-commenter

ping @chaunceyjiang could you help take a look?

whitewindmills avatar Jan 15 '24 09:01 whitewindmills

/lgtm /kind cleanup

XiShanYongYe-Chang avatar Jan 15 '24 09:01 XiShanYongYe-Chang

Kind ping @chaunceyjiang @RainbowMango /cc @chaunceyjiang @RainbowMango

XiShanYongYe-Chang avatar Jan 22 '24 14:01 XiShanYongYe-Chang

Could you help move it forward? /assign @RainbowMango

whitewindmills avatar Feb 29 '24 06:02 whitewindmills

@chaunceyjiang Do you want to take another look? As you are the related code author.

RainbowMango avatar Feb 29 '24 07:02 RainbowMango

@chaunceyjiang Could you help take a look?

whitewindmills avatar Apr 16 '24 08:04 whitewindmills

Hi @whitewindmills, We can move forward with this PR. Can you rebase it and confirm if there are any required changes?

XiShanYongYe-Chang avatar May 25 '24 09:05 XiShanYongYe-Chang

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from rainbowmango. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

karmada-bot avatar May 27 '24 01:05 karmada-bot

ping @RainbowMango @XiShanYongYe-Chang @chaunceyjiang

whitewindmills avatar May 27 '24 02:05 whitewindmills

/assign

chaunceyjiang avatar May 28 '24 03:05 chaunceyjiang

ping @chaunceyjiang

whitewindmills avatar May 30 '24 06:05 whitewindmills