-
Notifications
You must be signed in to change notification settings - Fork 386
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
Update openflow rules when Gateway updates #4388
Conversation
/test-multicluster-e2e |
Codecov Report
@@ Coverage Diff @@
## main #4388 +/- ##
==========================================
+ Coverage 64.85% 65.03% +0.17%
==========================================
Files 397 410 +13
Lines 56239 56666 +427
==========================================
+ Hits 36473 36850 +377
- Misses 17097 17148 +51
+ Partials 2669 2668 -1
|
ee90f06
to
3d8e872
Compare
@@ -282,15 +291,13 @@ func (c *MCRouteController) syncMCFlowsForAllCIImps(activeGW *mcv1alpha1.Gateway | |||
return err | |||
} | |||
|
|||
activeGWNochange := c.checkGateWayIPChange(activeGW) |
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.
activeGWNoChange
But maybe rename it to "noActiveGWChange".
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.
renamed to activeGWChanged
.
@@ -310,9 +329,9 @@ func (c *MCRouteController) addMCFlowsForAllCIImps(activeGW *mcv1alpha1.Gateway) | |||
klog.V(2).InfoS("No remote ClusterInfo imported, do nothing") | |||
return nil | |||
} | |||
|
|||
activeGWNochange := c.checkGateWayIPChange(activeGW) |
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.
I think we should just pass "false" to addMCFlowsForSingleCIImp()? addMCFlowsForAllCIImps is called when activeGW is not set earlier, and so it cannot be noChange?
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.
Yeah, you are right, change it to true since the name is activeGWChanged
now.
@@ -323,19 +342,24 @@ func (c *MCRouteController) addMCFlowsForAllCIImps(activeGW *mcv1alpha1.Gateway) | |||
return nil | |||
} | |||
|
|||
func (c *MCRouteController) addMCFlowsForSingleCIImp(activeGW *mcv1alpha1.Gateway, ciImport *mcv1alpha1.ClusterInfoImport, installedCIImp *mcv1alpha1.ClusterInfoImport) error { | |||
func (c *MCRouteController) addMCFlowsForSingleCIImp(activeGW *mcv1alpha1.Gateway, ciImport *mcv1alpha1.ClusterInfoImport, | |||
installedCIImp *mcv1alpha1.ClusterInfoImport, activeGWNochange bool) error { |
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.
Nit - just from this func perspective, maybe easier to understand if we pass an "activeGWChanged" argument.
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.
Done
fe26508
to
ec3fa49
Compare
/test-multicluster-e2e |
/test-all |
@luolanzone : UBI build is failing. Could you rebase and fix that? |
There is a bug when GatewayIP or InternalIP of active Gateway is changed, the corresponding openflow rules won't be updated until any other event triggers the flow sync process. Fix the bug by comparing installed active Gateway's InternalIP and GatewayIP with current active Gateway. And add more unit tests to cover Gateway update event. Signed-off-by: Lan Luo <luola@vmware.com>
ec3fa49
to
9352c8b
Compare
@jianjuns I re-based and pushed the latest codes. thanks. |
Ok. Please make sure test-all and required tests passed. |
/test-multicluster-e2e |
1 similar comment
/test-multicluster-e2e |
@XinShuYang Could you help to check if jenkins has some problem to send back the test result? I can see multicluster e2e passed in the jenkins, but it shows failed here in the github check. |
/test-multicluster-e2e |
/test-all |
/test-networkpolicy |
) When GatewayIP or InternalIP of active Gateway changes, the corresponding Openflow rules are not updated until any other event triggers the flow sync process. Fix the issue by comparing installed active Gateway's InternalIP and GatewayIP with the current active Gateway. And add more unit tests to cover Gateway update events. Signed-off-by: Lan Luo <luola@vmware.com>
There is a bug when GatewayIP or InternalIP of active Gateway is changed, the corresponding openflow rules won't be updated until any other event triggers the flow sync process.
Fix the bug by comparing installed active Gateway's InternalIP and GatewayIP with current active Gateway. And add more unit tests to cover Gateway update event.
Signed-off-by: Lan Luo luola@vmware.com