-
Notifications
You must be signed in to change notification settings - Fork 1k
Remove unnecessary update and delete events in cert-rotation-controller #6989
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Yaten <[email protected]>
|
Welcome @yaten2302! It looks like this is your first PR to karmada-io/karmada 🎉 |
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary of ChangesHello @yaten2302, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the event watching mechanism within the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request correctly removes the handling of update and delete events in NewClusterPredicateOnAgent. By making UpdateFunc and DeleteFunc always return false, any controller using this predicate will no longer trigger unnecessary reconciliations for these events, which is a good optimization. The accompanying test changes in predicate_test.go accurately reflect this new behavior. The change is sound and well-implemented.
|
Hi @zhzhuang-zju can you help take a review? |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6989 +/- ##
==========================================
- Coverage 46.62% 46.60% -0.02%
==========================================
Files 699 699
Lines 48164 48156 -8
==========================================
- Hits 22456 22445 -11
- Misses 24013 24016 +3
Partials 1695 1695
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi @yaten2302, there are some lint errors. |
Signed-off-by: Yaten <[email protected]>
|
Hi @XiShanYongYe-Chang , the CI workflow which is failing, I've a doubt that, the failing test is - https://github.com/karmada-io/karmada/actions/runs/19868522315/job/56938370989?pr=6989. But, this comes under I've fixed the linter errors though 👀 the workflow is passing for that. |
|
/retest |
|
@XiShanYongYe-Chang , kindly approve one pending test :) |
XiShanYongYe-Chang
left a comment
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.
Hi, @yaten2302
The current predicate is being used by two controllers, but the current modification logic does not apply to the cluster-status-controller. You may need to adjust the modification method to prevent the impact from spreading.
|
@XiShanYongYe-Chang , ig you already have an open PR for this :) Once your PR is merged, this will prevent the effect from spreading. Should I incorporate this behaviour in my PR? |
|
You're right. Let's wait for my PR to be merged first, so you can rebase later. If you are willing to continue contributing, you can follow up on this issue: |
Sure 👍
Yes, I'm willing to contribute more to the project, I'll pick up one more good first issue and then I'll probably try to find some good ones, like major changes/refactor/bugs or anything required at that point. |
Currently using the |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
The cert-rotation-controller only need to watch the creation event of the cluster object, as the cluster object will be processed periodically, so there is no need to watch the update or deletion events of the cluster.
Which issue(s) this PR fixes:
Fixes #6780
Does this PR introduce a user-facing change?: