Conversation
Summary of ChangesHello @changluyi, 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 related to "garbage" OpenFlow rules in Underlay-to-Overlay (U2O) communication within Kube-OVN. The changes enhance the robustness of pod deletion handling by ensuring critical pod data is available during the cleanup process, preventing potential issues where OpenFlow rules might not be properly removed. Additionally, the logic for adding OpenFlow rules has been made more precise to avoid redundant entries. A new E2E test has been introduced to thoroughly validate these fixes and ensure the stability of U2O OpenFlow rule management. 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.
Code Review
This pull request effectively addresses a race condition during pod deletion that could lead to stale OpenFlow rules. The approach of caching the pod object at deletion enqueue time is robust. The change to make the OpenFlow rule existence check more specific is a good improvement, and the new end-to-end test provides excellent coverage for the fix. I have a couple of minor suggestions to further refine the code.
| if actionText, _ := action.MarshalText(); string(actionText) == expectedAction { | ||
| klog.V(3).Infof("flow already exists in bridge %s for in_port=%d, ip_src=%s, dl_src=%s, actions=mod_dl_src:%s", | ||
| bridgeName, localnetPatchPortID, podIP, chassisMac, podMac) | ||
| return nil | ||
| } |
There was a problem hiding this comment.
The error returned by action.MarshalText() is being ignored. While errors might be rare for standard OpenFlow actions, it's safer to handle them to prevent unexpected behavior. Please consider checking the error and logging it if it's not nil.
actionText, err := action.MarshalText()
if err != nil {
klog.Warningf("failed to marshal action from flow: %v", err)
continue
}
if string(actionText) == expectedAction {
klog.V(3).Infof("flow already exists in bridge %s for in_port=%d, ip_src=%s, dl_src=%s, actions=mod_dl_src:%s",
bridgeName, localnetPatchPortID, podIP, chassisMac, podMac)
return nil
}|
|
||
| ginkgo.By("Verifying keepSrcMac OpenFlow rules are deleted after pod deletion") | ||
| // Wait a bit for the flow rules to be cleaned up | ||
| time.Sleep(2 * time.Second) |
There was a problem hiding this comment.
Pull Request Test Coverage Report for Build 18083704987Details
💛 - Coveralls |
Signed-off-by: clyi <clyi@alauda.io>
c0d5d20 to
9c98da1
Compare
* fix delete pod not remove u2o flow Signed-off-by: clyi <clyi@alauda.io>
Pull Request
What type of this PR
Examples of user facing changes:
Which issue(s) this PR fixes
Fixes #(issue-number)