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
egressgw: consider egress interface when deleting stale IP rules #26846
egressgw: consider egress interface when deleting stale IP rules #26846
Conversation
When an EgressGW policy was updated to select a different egress interface, delete all IP rules that still point to the old interface. Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
/test |
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, one minor cosmetic comment
@@ -56,6 +57,8 @@ const ( | |||
|
|||
egressIP1 = "192.168.101.1" | |||
egressCIDR1 = "192.168.101.1/24" | |||
egressIP2 = "192.168.102.1" | |||
egressCIDR2 = "192.168.102.1/24" |
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.
Not that it matters, but maybe 192.168.102.0/24
looks more canonical?
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 would agree, but right now that change causes the tests to fail 🤔. Needs a closer eye why that is.
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.
Ok, I see. I think code parses this CIDR as an IP address in func parseIPRule(sourceIP, destCIDR, egressIP string, ifaceIndex int)
(it parses it as a CIDR, but then only uses the IP address part), didn't look too precise
Marking as |
When an EgressGW policy was updated to select a different egress interface, delete all IP rules that still point to the old interface.