-
Notifications
You must be signed in to change notification settings - Fork 387
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
Handle iptables-restore failures correctly in NPL Controller #2555
Handle iptables-restore failures correctly in NPL Controller #2555
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2555 +/- ##
==========================================
+ Coverage 60.09% 65.01% +4.92%
==========================================
Files 281 281
Lines 22243 25524 +3281
==========================================
+ Hits 13366 16594 +3228
+ Misses 7467 7391 -76
- Partials 1410 1539 +129
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/test-all |
@@ -117,6 +119,14 @@ func podKeyFunc(pod *corev1.Pod) string { | |||
return pod.Namespace + "/" + pod.Name | |||
} | |||
|
|||
func (c *NPLController) Initialize() error { | |||
klog.InfoS("Will fetch Pods and generate NodePortLocal rules for these Pods") | |||
if err := c.GetPodsAndGenRules(); err != nil { |
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.
After it's extracted to a method and called separately, it doesn't wait for cache to sync, I think it may miss Pod data?
Add a retry mechanism in the Controller initialization, which will keep trying to sync iptables rules until the operation is successful. On success, the NPL Controller is notified through a channel and can start its event handlers. Fixes antrea-io#2554 Signed-off-by: Antonin Bas <[email protected]>
Signed-off-by: Antonin Bas <[email protected]>
c08cb85
to
d366acc
Compare
@tnqn thanks for the review. I believe you are right about the cache. I pushed a second commit to address it. Please let me know if you have a more elegant solution to suggest. |
/test-e2e |
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.
LGTM
Signed-off-by: Antonin Bas <[email protected]>
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.
LGTM
/test-all |
…ectly in NPL (#2575) Add a retry mechanism in the Controller initialization, which will keep trying to sync iptables rules until the operation is successful. On success, the NPL Controller is notified through a channel and can start its event handlers. Fixes #2554 Signed-off-by: Antonin Bas <[email protected]>
…io#2555) Add a retry mechanism in the Controller initialization, which will keep trying to sync iptables rules until the operation is successful. On success, the NPL Controller is notified through a channel and can start its event handlers. Fixes antrea-io#2554 Signed-off-by: Antonin Bas <[email protected]>
Add a retry mechanism in the Controller initialization, which will keep
trying to sync iptables rules until the operation is successful. On
success, the NPL Controller is notified through a channel and can start
its event handlers.
Fixes #2554
Signed-off-by: Antonin Bas [email protected]