-
Notifications
You must be signed in to change notification settings - Fork 911
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
reduce unnecessary update when processing in the workstatus controller #3804
base: master
Are you sure you want to change the base?
reduce unnecessary update when processing in the workstatus controller #3804
Conversation
Signed-off-by: changzhen <changzhen5@huawei.com>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
@XiShanYongYe-Chang: GitHub didn't allow me to request PR reviews from the following users: MingZhang-YBPS. Note that only karmada-io members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this: 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/test-infra repository. |
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #3804 +/- ##
==========================================
+ Coverage 55.65% 55.70% +0.04%
==========================================
Files 225 225
Lines 21319 21348 +29
==========================================
+ Hits 11865 11891 +26
- Misses 8821 8824 +3
Partials 633 633
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
||
return !(propagateAnnotationsChanged(desiredObj.GetAnnotations(), clusterObj.GetAnnotations()) || | ||
propagateLabelsChange(desiredObj.GetLabels(), clusterObj.GetLabels(), | ||
strings.Split(clusterObj.GetAnnotations()[workv1alpha2.ManagedLabels], ","))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a new line for strings.Split()
would be better
|
||
keysStr, exist := clusterMaps[workv1alpha2.ManagedAnnotation] | ||
if !exist { | ||
_, exist = desireMaps[workv1alpha2.ManagedAnnotation] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
desireMaps -> desiredAnnotations
Strongly recommend move related codes out of |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
In the
workstatus-controller
, when collecting the work status, it will check if there are any changes in the resources propagated by Karmada on the member clusters. At this time, it is necessary to check for changes in annotations and labels on the resources because we allow users to add new annotations and labels to the resources. Therefore, we only need to check those annotations and labels controlled by Karmada.Which issue(s) this PR fixes:
Fixes #3204
Special notes for your reviewer:
Does this PR introduce a user-facing change?: