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

feat: set conflictResolution for dependent resources. #4418

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

chaunceyjiang
Copy link
Member

What type of PR is this?
/kind feature

What this PR does / why we need it:

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

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-controller-manager`: set conflictResolution for dependent resources.

@karmada-bot karmada-bot added kind/feature Categorizes issue or PR as related to a new feature. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 14, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2023

⚠️ 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 41.36%. Comparing base (53c00f7) to head (38bb553).

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4418      +/-   ##
==========================================
- Coverage   41.38%   41.36%   -0.02%     
==========================================
  Files         651      651              
  Lines       55259    55265       +6     
==========================================
- Hits        22867    22863       -4     
- Misses      30913    30921       +8     
- Partials     1479     1481       +2     
Flag Coverage Δ
unittests 41.36% <100.00%> (-0.02%) ⬇️

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.

@chaosi-zju
Copy link
Member

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 14, 2023
@XiShanYongYe-Chang
Copy link
Member

/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.

Thanks~
/lgtm
/cc @RainbowMango

@chaunceyjiang
Copy link
Member Author

/cc @RainbowMango PTAL.

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.

Hi @chaunceyjiang
I think it's time to move this forward:

  1. The [Summer OSPP 2024] Karmada supports smooth rollback of a single cluster #5380 is relying on this fix
  2. I will open another issue to track the task that disables sharing the dependencies.

Reduplicated PR: #5731

pkg/dependenciesdistributor/dependencies_distributor.go Outdated Show resolved Hide resolved
pkg/dependenciesdistributor/dependencies_distributor.go Outdated Show resolved Hide resolved
@karmada-bot karmada-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 25, 2024
@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 25, 2024
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
@@ -561,6 +561,11 @@ func (d *DependenciesDistributor) createOrUpdateAttachedBinding(attachedBinding
bindingKey := client.ObjectKeyFromObject(attachedBinding)
err := d.Client.Get(context.TODO(), bindingKey, existBinding)
if err == nil {
// If the spec.Placement is nil, this means that existBinding is generated by the dependency mechanism.
// If the spec.Placement is not nil, then it must be generated by PropagationPolicy.
if existBinding.Spec.Placement == nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

Increase this IF statement to determine the existBinding, make sure it was created by the dependencies_distributor,then we can modify ConflictResolution.

@chaunceyjiang
Copy link
Member Author

/cc @chaosi-zju @RainbowMango PTAL.

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.

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 25, 2024
@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 Oct 25, 2024
@karmada-bot karmada-bot merged commit f7d6da3 into karmada-io:master Oct 25, 2024
15 checks passed
@chaunceyjiang chaunceyjiang deleted the pr_4410 branch October 25, 2024 08:56
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.

dependency resource propagate failed when already created in member cluster.
6 participants