karmada icon indicating copy to clipboard operation
karmada copied to clipboard

skip cleanup when the poliyMarks changed

Open zhzhuang-zju opened this issue 1 year ago • 14 comments

What type of PR is this? /kind bug

What this PR does / why we need it: Refer to #5307, there is a chance that poliy marks be lost when deleting the old pp/cpp and binding a new one. When performing a clean up of marks on rb/crb, we can compare the value of the label policyv1alpha1.ClusterPropagationPolicyPermanentIDLabel/policyv1alpha1.PolicyPermanentIDLabel on the cb/crb with the policyId value of the deleted CPP/PP. If they are not the same, it indicates that the rb/crb has already claimed to a new CPP/PP, and there is no need to clean up the label/annotation.

Which issue(s) this PR fixes: Fixes #5307

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-controller-manager`: Fixed an issue that poliyMarks might be lost when deleting the old pp/cpp and binding a new one

zhzhuang-zju avatar Aug 07 '24 02:08 zhzhuang-zju

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 17.85714% with 23 lines in your changes missing coverage. Please review.

Project coverage is 35.90%. Comparing base (11d5c97) to head (08026dc).

Files with missing lines Patch % Lines
pkg/detector/detector.go 0.00% 23 Missing :warning:

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5319      +/-   ##
==========================================
- Coverage   35.91%   35.90%   -0.01%     
==========================================
  Files         648      648              
  Lines       45064    45079      +15     
==========================================
+ Hits        16185    16187       +2     
- Misses      27634    27646      +12     
- Partials     1245     1246       +1     
Flag Coverage Δ
unittests 35.90% <17.85%> (-0.01%) :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 Aug 07 '24 03:08 codecov-commenter

cc @whitewindmills @XiShanYongYe-Chang

zhzhuang-zju avatar Aug 07 '24 03:08 zhzhuang-zju

/assign

whitewindmills avatar Aug 07 '24 03:08 whitewindmills

let @XiShanYongYe-Chang make the final decision. /assign @XiShanYongYe-Chang

whitewindmills avatar Aug 07 '24 08:08 whitewindmills

Thanks~ /lgtm

XiShanYongYe-Chang avatar Aug 08 '24 01:08 XiShanYongYe-Chang

cc @RainbowMango

zhzhuang-zju avatar Aug 08 '24 03:08 zhzhuang-zju

Hi @whitewindmills can we merge this pr?

XiShanYongYe-Chang avatar Aug 09 '24 07:08 XiShanYongYe-Chang

yes

whitewindmills avatar Aug 09 '24 07:08 whitewindmills

It's ready to merge. Ask @RainbowMango to help make a check again. /assign @RainbowMango

XiShanYongYe-Chang avatar Aug 16 '24 02:08 XiShanYongYe-Chang

Does this need to be included in the coming patch release? #5373

RainbowMango avatar Aug 16 '24 07:08 RainbowMango

Does this need to be included in the coming patch release? #5373

In terms of the frequency and severity of the issue, it's not very urgent. However, if needed, I can cherry-pick it to the corresponding release branch as soon as possible.

zhzhuang-zju avatar Aug 16 '24 07:08 zhzhuang-zju

kindly ping @RainbowMango

zhzhuang-zju avatar Aug 19 '24 12:08 zhzhuang-zju

kindly ping @RainbowMango

zhzhuang-zju avatar Aug 29 '24 11:08 zhzhuang-zju

/hold util #5563 merged

zhzhuang-zju avatar Sep 19 '24 07:09 zhzhuang-zju

/hold util #5563 merged

Whis this PR should wait for #5563?

RainbowMango avatar Sep 23 '24 02:09 RainbowMango

in #5563, I have extracted some common methods, which will affect this PR.

zhzhuang-zju avatar Sep 23 '24 02:09 zhzhuang-zju

/hold cancel

zhzhuang-zju avatar Oct 09 '24 07:10 zhzhuang-zju

#5563 has been merged, so this PR can now proceed

cc @whitewindmills @RainbowMango @XiShanYongYe-Chang

zhzhuang-zju avatar Oct 09 '24 07:10 zhzhuang-zju

OK. I will take a look.

RainbowMango avatar Oct 09 '24 07:10 RainbowMango

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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:

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 Oct 10 '24 03:10 karmada-bot