-
Notifications
You must be signed in to change notification settings - Fork 960
Automated cherry pick of #6525: don't recreate resource in the member cluster when it is #6537
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
Automated cherry pick of #6525: don't recreate resource in the member cluster when it is #6537
Conversation
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.
Summary of Changes
Hello @luyb177, 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, a cherry-pick from #6525, introduces a crucial fix to prevent the unintended recreation of resources in member clusters. Specifically, it ensures that if a Work
object is marked as suspended for dispatching, the system will not attempt to re-provision the associated resource, thereby avoiding unnecessary operations and potential conflicts.
Highlights
- Resource Recreation Prevention: The
WorkStatusController
'shandleDeleteEvent
now includes a check to see if theWork
object is suspended for dispatching. If it is, the controller will skip further processing, effectively preventing the recreation of the resource in the member cluster. - Enhanced Test Coverage: A new test case has been added to
TestWorkStatusController_syncWorkStatus
to explicitly verify that resources are not recreated in the member cluster when their correspondingWork
object hasSuspendDispatching
set to true. This improves the robustness of the controller.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
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 .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and 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 to provide feedback.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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 is a cherry-pick that prevents the work-status-controller
from recreating a resource in a member cluster if the corresponding Work
object has spec.suspendDispatching
set to true
. The change is implemented in handleDeleteEvent
and is accompanied by a new test case that verifies the corrected behavior. The implementation is correct and the tests are adequate. The changes look good to me.
@@ -294,6 +294,12 @@ func (c *WorkStatusController) handleDeleteEvent(ctx context.Context, key keys.F | |||
return nil | |||
} | |||
|
|||
// skip processing as the work object is suspended for dispatching. | |||
if util.IsWorkSuspendDispatching(work) { |
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.
The file for the IsWorkSuspendDispatching
method has undergone changes. In versions 1.12 and 1.13, it was still located under the helper
package.
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.
This cannot be automatically modified through the cherry-pick script; it requires your manual intervention. @luyb177
5164545
to
323a571
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## release-1.13 #6537 +/- ##
================================================
- Coverage 47.99% 47.99% -0.01%
================================================
Files 674 674
Lines 55872 55875 +3
================================================
- Hits 26818 26816 -2
- Misses 27307 27312 +5
Partials 1747 1747
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:
|
323a571
to
4e91842
Compare
return nil | ||
} | ||
|
||
//nolint:staticcheck // SA1019 ignore deprecated util.PropagationInstruction |
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.
The PropagationInstruction
may not have been deprecated in version 1.13, so this line can be removed.
…r dispatching Signed-off-by: changzhen <[email protected]>
4e91842
to
e2df648
Compare
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.
Thanks ~
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: XiShanYongYe-Chang 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 |
Cherry pick of #6525 on release-1.13.
#6525: don't recreate resource in the member cluster when it is
For details on the cherry pick process, see the cherry pick requests page.