Handling mutliple namespaces#41
Conversation
Summary of ChangesHello @zeeke, 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 significantly enhances the MultiNetworkPolicy functionality by enabling it to manage network policies across multiple Kubernetes namespaces and NetworkAttachmentDefinitions. The core change involves updating the policy enforcement mechanism to correctly identify and apply rules based on the 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
This pull request correctly refactors the logic to handle multiple namespaces for network policies by leveraging the policy-for annotation. The addition of a new end-to-end test for multi-namespace scenarios is a great improvement. My review focuses on improving the reliability of the new test and fixing a minor typo in the Go code.
448c8d7 to
d181138
Compare
Signed-off-by: Andrea Panattoni <apanatto@redhat.com>
2d6162b to
13c3546
Compare
13c3546 to
7a54c80
Compare
mlguerrero12
left a comment
There was a problem hiding this comment.
Nice work @zeeke! Just some minor comments
A networkpolicy can refer to multiple NADs, which can be in different namespaces. Avoid filtering peerPods using the exact networkname and use the policy's `policy-for` annotation. Create an end2end test case that involves pods from multiple namespaces. Signed-off-by: Andrea Panattoni <apanatto@redhat.com>
Signed-off-by: Andrea Panattoni <apanatto@redhat.com>
7a54c80 to
4c73a85
Compare
|
Thanks @mlguerrero12 for the review! I addressed your comments (Hope everything is going well in your new adventure! 😃) |
A networkpolicy can refer to multiple NADs, which can be in different namespaces.
Avoid filtering peerPods using the exact networkname and use the policy's
policy-forannotation.Create an end2end test case that involves pods from multiple namespaces.
Improve the integration test verification method by introducing the golden file pattern, which also offers a better understanding of the nftables generated by the controller.