karmada icon indicating copy to clipboard operation
karmada copied to clipboard

Add annotation to the the resource template to prevent removal managed resources

Open CharlesQQ opened this issue 1 year ago • 17 comments

What type of PR is this?

What this PR does / why we need it: Extend the API field orphaningDeletion to prevent removal managed resources

Which issue(s) this PR fixes: Fixes https://github.com/karmada-io/karmada/issues/4709

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


CharlesQQ avatar Apr 01 '24 10:04 CharlesQQ

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 53.34%. Comparing base (d676996) to head (2e44070). Report is 6 commits behind head on master.

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4788      +/-   ##
==========================================
+ Coverage   53.31%   53.34%   +0.02%     
==========================================
  Files         252      253       +1     
  Lines       20539    20565      +26     
==========================================
+ Hits        10951    10971      +20     
- Misses       8862     8868       +6     
  Partials      726      726              
Flag Coverage Δ
unittests 53.34% <100.00%> (+0.02%) :arrow_up:

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 Apr 01 '24 10:04 codecov-commenter

/kind feature

XiShanYongYe-Chang avatar Apr 23 '24 08:04 XiShanYongYe-Chang

Hi @CharlesQQ @chaunceyjiang Is there any blockage in this PR now? Can we move forward?

XiShanYongYe-Chang avatar May 10 '24 03:05 XiShanYongYe-Chang

Hi @CharlesQQ @chaunceyjiang Is there any blockage in this PR now? Can we move forward?

https://github.com/karmada-io/karmada/pull/4788#discussion_r1582008275 Regarding this plan, it seems that there is no conclusion yet?

chaunceyjiang avatar May 10 '24 03:05 chaunceyjiang

Let's invite @RainbowMango and @whitewindmills give some opinion. /cc @RainbowMango @whitewindmills

XiShanYongYe-Chang avatar May 10 '24 03:05 XiShanYongYe-Chang

/assign

RainbowMango avatar May 10 '24 06:05 RainbowMango

Regarding this plan, it seems that there is no conclusion yet?

Yes, To sum up, it seems inappropriate to put fields in pp/cpp

CharlesQQ avatar May 13 '24 02:05 CharlesQQ

@XiShanYongYe-Chang @RainbowMango @CharlesQQ @whitewindmills Do we have a consensus on the current proposal?

chaunceyjiang avatar May 15 '24 03:05 chaunceyjiang

We may not reached a unanimous conclusion yet. Work suspension might also can learn from this discussion. They are both processing policies for resource templates and can be decoupled from PP.

There should be three options at this point,

  • Solution 1: Define a resource deletion policy in the PP.
    • disadvantage:
      • Coupled with the PP, the PP becomes larger and larger with the evolution.
  • Solution 2: Add an annotation to the resource template to describe the deletion policy of the target resource.
    • disadvantage:
      • Poor API evolution.
  • Solution 3: A new CRD is defined to describe a deletion policy of one or more resources.
    • disadvantage:
      • Increased learning costs and CRs

You can publish it, or we can have a meeting to discuss and decide.

XiShanYongYe-Chang avatar May 15 '24 03:05 XiShanYongYe-Chang

@XiShanYongYe-Chang @RainbowMango @CharlesQQ @whitewindmills Do we have a consensus on the current proposal?

Can we set up a time to discuss this plan? When would be a good time for you, or maybe next Tuesday at the community meeting?

XiShanYongYe-Chang avatar May 16 '24 03:05 XiShanYongYe-Chang

Any update on this one?

buji-code avatar May 22 '24 19:05 buji-code

@buji-code Yeah, after discussion at the community meeting, we decided to try out solution 2 and 3. This work will start in the next release, early next month.

XiShanYongYe-Chang avatar May 23 '24 01:05 XiShanYongYe-Chang

Hi guys @CharlesQQ @whitewindmills @chaunceyjiang @RainbowMango @buji-code

Can we proceed with solution 2: Add an annotation to the resource template to describe the deletion policy of the target resource first, and then consider designing and adding a CRD to describe the deletion policy as the scenario develops? (Of course, the use of annotations is not excluded as the ideal end use.)

XiShanYongYe-Chang avatar May 23 '24 14: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 Aug 13 '24 02:08 karmada-bot

👋🏼 happy to contribute if I can push this forward (design or implementation)

a7i avatar Aug 29 '24 17:08 a7i

happy to contribute if I can push this forward (design or implementation)

the latest proposal is here: https://github.com/karmada-io/karmada/pull/5101

now we stuck at: here are four optional resolutions, and we haven't decided which is best.

could you help sharing opinions about which is the best practice?

chaosi-zju avatar Aug 30 '24 01:08 chaosi-zju

👋🏼 happy to contribute if I can push this forward (design or implementation)

Sure thing! Thank you Amir in advance. I'll look at the proposal and see how I can help with it.

RainbowMango avatar Aug 30 '24 02:08 RainbowMango

Hi everyone, let's use umbrella issue https://github.com/karmada-io/karmada/issues/5577 to track this requirement. /close

XiShanYongYe-Chang avatar Sep 21 '24 02:09 XiShanYongYe-Chang

@XiShanYongYe-Chang: Closed this PR.

In response to this:

Hi everyone, let's use umbrella issue https://github.com/karmada-io/karmada/issues/5577 to track this requirement. /close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

karmada-bot avatar Sep 21 '24 02:09 karmada-bot