Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement preserveResourcesOnDeletion to support migration rollback #5597

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

a7i
Copy link
Contributor

@a7i a7i commented Sep 23, 2024

What type of PR is this?
/kind feature

What this PR does / why we need it:
Covers function implementation of #5577

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
I am open to implementing e2e tests but holding off per @XiShanYongYe-Chang 's recommendation

Does this PR introduce a user-facing change?:

Resource deletion policy to support migration rollback

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 23, 2024
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 23, 2024
@a7i a7i force-pushed the amir/preserveResourcesOnDeletion branch from 9633161 to 90270f8 Compare September 23, 2024 20:57
@a7i a7i force-pushed the amir/preserveResourcesOnDeletion branch 3 times, most recently from 21604d0 to d101b90 Compare September 24, 2024 02:35
@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2024

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

Codecov Report

Attention: Patch coverage is 41.50943% with 62 lines in your changes missing coverage. Please review.

Project coverage is 38.40%. Comparing base (268e672) to head (68c0104).

Files with missing lines Patch % Lines
pkg/controllers/execution/execution_controller.go 51.66% 20 Missing and 9 partials ⚠️
pkg/detector/detector.go 0.00% 17 Missing ⚠️
pkg/controllers/binding/common.go 27.27% 8 Missing ⚠️
pkg/util/helper/work.go 0.00% 2 Missing ⚠️
pkg/controllers/mcs/service_export_controller.go 0.00% 1 Missing ⚠️
...clusterservice/endpointslice_collect_controller.go 0.00% 1 Missing ⚠️
...lusterservice/endpointslice_dispatch_controller.go 0.00% 0 Missing and 1 partial ⚠️
.../controllers/multiclusterservice/mcs_controller.go 0.00% 0 Missing and 1 partial ⚠️
...controllers/namespace/namespace_sync_controller.go 0.00% 0 Missing and 1 partial ⚠️
...controllers/unifiedauth/unified_auth_controller.go 0.00% 0 Missing and 1 partial ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5597      +/-   ##
==========================================
+ Coverage   38.25%   38.40%   +0.14%     
==========================================
  Files         649      650       +1     
  Lines       45133    45207      +74     
==========================================
+ Hits        17267    17360      +93     
+ Misses      26556    26518      -38     
- Partials     1310     1329      +19     
Flag Coverage Δ
unittests 38.40% <41.50%> (+0.14%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@XiShanYongYe-Chang
Copy link
Member

Thanks a lot
/assign

@@ -39,7 +39,7 @@ import (
)

// CreateOrUpdateWork creates a Work object if not exist, or updates if it already exists.
func CreateOrUpdateWork(ctx context.Context, client client.Client, workMeta metav1.ObjectMeta, resource *unstructured.Unstructured, suspendDispatching *bool) error {
func CreateOrUpdateWork(ctx context.Context, client client.Client, workMeta metav1.ObjectMeta, resource *unstructured.Unstructured, options ...WorkOption) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elegant implementation, learned!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@XiShanYongYe-Chang
Copy link
Member

Hi @a7i, in addition to clearing labels and annotations, the current pr should be a complete pr. Can we clear labels in a separate pr? (This means that we can advance the integration of the current pr first, and we need to resolve the conflict.) How do you think?

@a7i a7i force-pushed the amir/preserveResourcesOnDeletion branch from d101b90 to 5a1ee31 Compare October 15, 2024 00:36
@a7i
Copy link
Contributor Author

a7i commented Oct 15, 2024

Hi @a7i, in addition to clearing labels and annotations, the current pr should be a complete pr. Can we clear labels in a separate pr? (This means that we can advance the integration of the current pr first, and we need to resolve the conflict.) How do you think?

Hi @XiShanYongYe-Chang 👋🏼 I pushed up a separate commit, let me know if you want it reverted or squashed. I still don't like that labels/annotations are not going to be easily maintainable but I can clean it up in a follow-up PR. Let me know what you think

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can modify this first, and then optimize label and annotation management in the next pr.
cc @RainbowMango

pkg/controllers/execution/execution_controller.go Outdated Show resolved Hide resolved
@a7i a7i force-pushed the amir/preserveResourcesOnDeletion branch from 5a1ee31 to 68c0104 Compare October 15, 2024 02:50
Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your quick response!
/lgtm
/assign @RainbowMango

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 15, 2024
@RainbowMango
Copy link
Member

I will look at it this week. Thanks.

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
Looks great!

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grosser, 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 karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 16, 2024
@RainbowMango RainbowMango added this to the v1.12 milestone Oct 16, 2024
@karmada-bot karmada-bot merged commit 19b32a2 into karmada-io:master Oct 16, 2024
12 checks passed
@a7i a7i deleted the amir/preserveResourcesOnDeletion branch October 16, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants