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: sync mcs work when cluster joined or unjoin #4360

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

Rains6
Copy link
Contributor

@Rains6 Rains6 commented Dec 3, 2023

What type of PR is this?
/kind feature

What this PR does / why we need it:
Referring to #4287

Which issue(s) this PR fixes:
Part of #4292

Special notes for your reviewer:
none

Does this PR introduce a user-facing change?:

`karmada-controller-manager`: Make `multiclusterservice` aware of Cluster changes.

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 3, 2023
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 3, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 3, 2023

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (27a3e54) 51.78% compared to head (8277a98) 51.88%.
Report is 22 commits behind head on master.

Files Patch % Lines
pkg/util/helper/mcs.go 0.00% 14 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4360      +/-   ##
==========================================
+ Coverage   51.78%   51.88%   +0.09%     
==========================================
  Files         243      243              
  Lines       24112    24114       +2     
==========================================
+ Hits        12487    12511      +24     
+ Misses      10944    10921      -23     
- Partials      681      682       +1     
Flag Coverage Δ
unittests 51.88% <0.00%> (+0.09%) ⬆️

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.

@Rains6 Rains6 force-pushed the dev-mcs-zhc branch 2 times, most recently from 2bdfca4 to b21bc54 Compare December 3, 2023 08:59
@Rains6 Rains6 changed the title feat: sync work when cluster joined or unjoin feat: sync mcs work when cluster joined or unjoin Dec 4, 2023
@karmada-bot karmada-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 4, 2023
@jwcesign
Copy link
Member

jwcesign commented Dec 4, 2023

I've made some changes: jwcesign@54312e0

Please review and incorporate any appropriate adjustments.

Copy link
Member

@jwcesign jwcesign left a comment

Choose a reason for hiding this comment

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

Other lgtm

pkg/controllers/multiclusterservice/mcs_controller.go Outdated Show resolved Hide resolved
…sponding cluster execution namespace

Signed-off-by: HongCen <zhouhongcen1@huawei.com>
@jwcesign
Copy link
Member

jwcesign commented Dec 4, 2023

lgtm
cc @RainbowMango @XiShanYongYe-Chang @chaunceyjiang for checking

@@ -460,6 +474,47 @@ func (c *MCSController) SetupWithManager(mgr controllerruntime.Manager) error {
return controllerruntime.NewControllerManagedBy(mgr).
For(&networkingv1alpha1.MultiClusterService{}, builder.WithPredicates(mcsPredicateFunc)).
Watches(&corev1.Service{}, handler.EnqueueRequestsFromMapFunc(svcMapFunc), builder.WithPredicates(svcPredicateFunc)).
Watches(&clusterv1alpha1.Cluster{}, handler.EnqueueRequestsFromMapFunc(c.clusterMapFunc())).
Copy link
Member

Choose a reason for hiding this comment

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

@jwcesign
Do we need to add an event filter?
Note that each cluster change would lead to list of all MultiClusterService in clusterMapFunc().

Copy link
Member

Choose a reason for hiding this comment

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

We can only accept changes to the cluster status condition.

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 Dec 5, 2023
@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 Dec 5, 2023
@karmada-bot karmada-bot merged commit 0b1681e into karmada-io:master Dec 5, 2023
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants