controller: set always_learn_from_arp_request to false only when LR is not connected to external network#5419
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @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 by refining how OVN logical router options are configured for VPCs. Specifically, it prevents the mac_binding_age_threshold from being set on VPCs that are connected to an external network, ensuring more appropriate network behavior based on the VPC's connectivity type.
Highlights
- Conditional MAC Binding Age: The
mac_binding_age_thresholdoption for OVN logical routers is now conditionally applied. It will only be set when a VPC is not configured to be connected to an external network. - Function Signature Update: The
createVpcRouterfunction inpkg/controller/vpc.gohas been updated to accept anenableExternalboolean parameter, which dictates whether the MAC binding age threshold should be applied.
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. ↩
33889f9 to
9927d24
Compare
There was a problem hiding this comment.
Code Review
This pull request modifies the VPC controller to conditionally set OVN logical router options. Specifically, it avoids setting mac_binding_age_threshold and other related options when a VPC is connected to an external network. The changes are logical and correct. I've provided one suggestion to improve maintainability by extracting the hardcoded router options.
Pull Request Test Coverage Report for Build 16044609411Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
963ffb6 to
fb80b5c
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
The pull request effectively addresses the objective of conditionally setting always_learn_from_arp_request based on whether the logical router is connected to an external network. The refactoring of createVpcRouter to accept the enableExternal parameter and the addition of the maps.Equal check before updating the logical router options are positive changes that improve both correctness and efficiency.
| if !maps.Equal(vpcRouter.Options, lrOptions) { | ||
| vpcRouter.Options = lrOptions | ||
| if err = c.OVNNbClient.UpdateLogicalRouter(vpcRouter, &vpcRouter.Options); err != nil { | ||
| klog.Errorf("failed to update options of logical router %s: %v", lr, err) | ||
| return err | ||
| } | ||
| } |
There was a problem hiding this comment.
The introduction of the if !maps.Equal(vpcRouter.Options, lrOptions) check is a valuable improvement. It ensures that the OVN logical router is only updated when its options have genuinely changed, preventing redundant OVSDB transactions. This can lead to better performance and reduced load on the OVN control plane.
fb80b5c to
4ac3d71
Compare
4ac3d71 to
5c8aff0
Compare
…s not connected to external network Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
f3972e0 to
df8c5f7
Compare
…s not connected to external network (#5419) Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
…s not connected to external network (kubeovn#5419) Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
…s not connected to external network (#5419) Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
|
@zhangzujian 大佬,U2O 场景下会有同样的问题么? |
|
@zhangzujian this will not fix the case where we have a underlay network attached to the default vpc (for u2o) as that network will no be marked as external (no need for nat gw), so bug #5318 will not be fixed |
|
@patriziobassi This patch is NOT a fix for the problem you metioned above. |
Pull Request
What type of this PR
Examples of user facing changes:
Which issue(s) this PR fixes
Fixes #(issue-number)