-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: replicaset KubeGroupNameAnnotation handling #4792
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
fix: replicaset KubeGroupNameAnnotation handling #4792
Conversation
Summary of ChangesHello @hajnalmt, 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 resolves a bug in the podgroup controller that led to the creation of unnecessary duplicate podgroups when pods were already annotated with an existing podgroup name. The fix introduces a check to prevent this redundant creation and is accompanied by new unit tests to ensure the correct handling of pre-annotated pods for both ReplicaSets and StatefulSets. Additionally, it includes a minor code style update and improved logging in some test cases. 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
|
Replicasets have created a podgroup that wasn't used by the pods when the "scheduling.k8s.io/group-name" annotation was on the pods. Signed-off-by: Hajnal Máté <hajnalmt@gmail.com>
00a33a7 to
380d393
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.
Code Review
This pull request fixes a bug where the podgroup controller would create a new podgroup for a pod even if one was already specified via an annotation. The fix is correctly implemented for the ReplicaSet handler, and new unit tests are added to verify the behavior for both ReplicaSets and StatefulSets. The changes are generally good, but I have a couple of suggestions to improve code compatibility and test robustness.
Minor error logging enhancements in the podGroup test cases additionally adding two test cases that will cover these problems when the annotation is present but the podgroup is created. Signed-off-by: Hajnal Máté <hajnalmt@gmail.com>
380d393 to
70eb849
Compare
hzxuzhonghu
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.
LGTM Give others a chance to have a look
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
|
Thank you for the review! You are superb guys |
|
/cherrypick release-1.13 |
|
@hajnalmt: new pull request created: #4826 DetailsIn 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. |
|
/cherrypick release-1.12 |
|
@hajnalmt: #4792 failed to apply on top of branch "release-1.12": DetailsIn 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. |
|
@hajnalmt: new issue created for failed cherrypick: #4827 DetailsIn 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. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Fixing a bug in the podgroup controller, where the user provided the podgroup in an annotation but we created the podgroup anyway disregarding it.
I added a unit test that covers the test case both for statefulsets and replicasets and added some minor enhancements regarding the logging in some other tests.
The failed unit test case output if the codes are not present:
For the replicaset:
For statefulset:
Which issue(s) this PR fixes:
Fixes #4784
Does this PR introduce a user-facing change?