controller: fix LSP gc when no ls key in external-ids#6103
controller: fix LSP gc when no ls key in external-ids#6103zhangzujian merged 2 commits intokubeovn:masterfrom
Conversation
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
Summary of ChangesHello @zhangzujian, 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 addresses a bug in the controller's garbage collection mechanism for Logical Switch Ports (LSPs). It refines the deletion operation to gracefully handle situations where the logical switch name might be empty or invalid, thereby enhancing the stability and reliability of the garbage collection process and preventing potential runtime issues. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 fixes a bug in the logical switch port (LSP) garbage collection that occurs when an LSP is missing the logical switch (LS) key in its external-ids. The original code would error when checking for the existence of an empty LS name. The change correctly adds a guard to only check for LS existence if the name is provided, allowing the subsequent logic to find the LS by the LSP's UUID. This is a good fix that makes the GC process more resilient. While outside the scope of this PR, a future improvement could be to make LogicalSwitchUpdatePortOp treat cases where an LSP is already detached from any LS as a no-op instead of an error to further improve robustness.
Pull Request Test Coverage Report for Build 20501951718Details
💛 - Coveralls |
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
Pull Request
What type of this PR
Examples of user facing changes:
Which issue(s) this PR fixes