fix(netpol): don't check if rules already exist in lax mode#5802
fix(netpol): don't check if rules already exist in lax mode#5802oilbeater merged 1 commit intokubeovn:masterfrom
Conversation
Summary of ChangesHello @SkalaNetworks, 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 resolves an issue within the network policy's 'Lax mode' that led to the generation of incorrect DHCP rules. The problem was caused by a redundant check that prevented the creation of Access Control Lists (ACLs) under the mistaken assumption they already existed, despite the system clearing all ACLs during network policy initialization. By modifying the code to bypass this unnecessary check, the change ensures that ACLs are correctly generated, thereby preventing the occurrence of faulty DHCP rules and improving network policy reliability. 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
The change to use newACLWithoutCheck is correct for the described scenario, as it avoids checking for pre-existing ACLs when they are expected to have been wiped. This should resolve the issue with faulty DHCP rule generation. I've added one suggestion to improve the code's correctness and maintainability by using the appropriate priority constant based on the traffic direction.
Signed-off-by: SkalaNetworks <contact@skala.network>
8c5443a to
e60b6e5
Compare
In some cases, Lax mode can generate faulty DHCP rules due to the ACLs not being generated.
This is the result of a check that doesn't generate an ACL if it already exists. Except we wipe every ACL when creating the Netpol, so we don't care if it already exists.
Note: this is unrelated to the issue I brought up on Slack.