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

fix the attached binding deletion problem #6034

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

whitewindmills
Copy link
Member

@whitewindmills whitewindmills commented Jan 10, 2025

What type of PR is this?
/kind bug

What this PR does / why we need it:

I created a deployment that used a PVC as it's dependent resource, and the PVC was able to follow the deployment propagation correctly. When I deleted the PVC and recreated it, I found that the PVC did not follow the deployment propagation because it's ResourceBinding was not created.

dependency_pr

Which issue(s) this PR fixes:
none

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-controller-manager`: Fixed the issue that newly created attached-ResourceBinding be mystically garbage collected.

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 10, 2025
@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 10, 2025
@whitewindmills
Copy link
Member Author

/cc @XiShanYongYe-Chang

@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2025

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

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.37%. Comparing base (be674c7) to head (b10c102).
Report is 6 commits behind head on master.

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6034      +/-   ##
==========================================
- Coverage   48.37%   48.37%   -0.01%     
==========================================
  Files         665      666       +1     
  Lines       54831    54835       +4     
==========================================
  Hits        26524    26524              
- Misses      26590    26593       +3     
- Partials     1717     1718       +1     
Flag Coverage Δ
unittests 48.37% <100.00%> (-0.01%) ⬇️

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, @whitewindmills let me take a look.
/assign

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.

This pr is similar to this logic processing scenario. Can we refer to this scenario:

// If this binding exists and its owner is not the input object, return error and let garbage collector
// delete this binding and try again later. See https://github.com/karmada-io/karmada/issues/2090.
if ownerRef := metav1.GetControllerOfNoCopy(bindingCopy); ownerRef != nil && ownerRef.UID != object.GetUID() {
return fmt.Errorf("failed to update binding due to different owner reference UID, will " +
"try again later after binding is garbage collected, see https://github.com/karmada-io/karmada/issues/2090")
}

@karmada-bot karmada-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 13, 2025
@whitewindmills
Copy link
Member Author

@XiShanYongYe-Chang PTAL

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~

@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 13, 2025
@whitewindmills
Copy link
Member Author

@XiShanYongYe-Chang PTAL

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~
/lgtm
Do you think we need to cherry-pick this patch to the previous branch?

/cc @RainbowMango

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 14, 2025
@whitewindmills
Copy link
Member Author

Do you think we need to cherry-pick this patch to the previous branch?

yes, it's necessary.

@whitewindmills
Copy link
Member Author

kindly ping @RainbowMango

@XiShanYongYe-Chang
Copy link
Member

yes, it's necessary.

Can you help add a release note?

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.

/assign

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

@karmada-bot
Copy link
Collaborator

[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 karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 15, 2025
@karmada-bot karmada-bot merged commit 2df42bd into karmada-io:master Jan 15, 2025
21 checks passed
@RainbowMango
Copy link
Member

I added a release note to this PR.

@RainbowMango RainbowMango added this to the v1.13 milestone Jan 15, 2025
@whitewindmills
Copy link
Member Author

@RainbowMango @XiShanYongYe-Chang
Which branch do you think I should start cherry-picking from?

@RainbowMango
Copy link
Member

All maintains branches, release-1.12, release-1.11, and release-1.10.

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/bug Categorizes issue or PR as related to a bug. 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.

5 participants