refactor(controller): clean up redundant logic in vpc controller#6295
refactor(controller): clean up redundant logic in vpc controller#6295
Conversation
Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com>
Summary of ChangesHello @oilbeater, 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 focuses on enhancing the Highlights
Changelog
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.
Code Review
This pull request does a great job of cleaning up redundant logic in the VPC controller, particularly around VPC update calls after deletions and simplifying function signatures. The changes make the code cleaner and easier to follow.
I've found one potential issue where a logic change might prevent subnets from being reconciled when their parent VPC is updated. I've left a detailed comment with a suggestion.
Otherwise, the refactoring and bug fixes look solid. Good work!
| if subnet.Status.IsNotReady() { | ||
| c.addOrUpdateSubnetQueue.Add(subnet.Name) | ||
| } |
There was a problem hiding this comment.
This change alters the logic for enqueuing subnets for reconciliation. Previously, all subnets of an updated VPC were enqueued. Now, only subnets not in a 'Ready' state are. This could prevent necessary updates on 'Ready' subnets when their parent VPC's configuration changes (e.g., spec.namespaces), potentially leading to inconsistencies.
The original code had a redundant if block. To correctly remove the redundancy while preserving the intended logic of reconciling all affected subnets, the unconditional enqueue should be kept.
c.addOrUpdateSubnetQueue.Add(subnet.Name)
Pull Request Test Coverage Report for Build 21931247912Details
💛 - Coveralls |
84c4a6b to
fadcd77
Compare
Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com>
fadcd77 to
4af77ff
Compare
* chore: remove unnecessary updates Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> * clean up vpc controller Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> --------- Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> (cherry picked from commit 436b519)
…eovn#6295) * chore: remove unnecessary updates Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> * clean up vpc controller Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> --------- Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> (cherry picked from commit 436b519)
Summary