-
Notifications
You must be signed in to change notification settings - Fork 370
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
Add L7 Antrea native NetworkPolicy support in controller #4406
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4406 +/- ##
==========================================
+ Coverage 63.56% 63.93% +0.37%
==========================================
Files 400 400
Lines 56849 57086 +237
==========================================
+ Hits 36137 36500 +363
+ Misses 18035 17880 -155
- Partials 2677 2706 +29
*This pull request uses carry forward flags. Click here to find out more.
|
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, suggested one more validation.
9234e21
to
ed2cb8b
Compare
if port.Protocol != nil && *port.Protocol != v1.ProtocolTCP { | ||
return "layer 7 protocols can only be used when layer 4 protocol is TCP or unset", false |
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 all layer 7 protocols are based on TCP, though the only supported protocol http is. To avoid confusion and to be extensible, it should validate the l4 protocol is either unset or TCP if the l7 protocol is http, and the error message should say "HTTP protocol can only be used when layer 4 protocol is TCP or unset"
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.
Updated for protocols and ports. Added verification for toServices.
ed2cb8b
to
3f185d2
Compare
b0d6e2c
to
69a0c9a
Compare
Add support for passing L7Protocols to agent when processing ACNP and ANP. Add validation for Antrea native policy for L7Protocols (HTTP only) to be used with Ports/Protocols, only supports Allow, and not used with toServices. Add UT. Signed-off-by: Qiyue Yao <[email protected]>
69a0c9a
to
cb81da6
Compare
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 |
) Add support for passing L7Protocols to agent when processing ACNP and ANP. Add validation for Antrea native policy for L7Protocols (HTTP only) to be used with Ports/Protocols, only supports Allow, and not used with toServices. Add UT. Signed-off-by: Qiyue Yao <[email protected]>
) Add support for passing L7Protocols to agent when processing ACNP and ANP. Add validation for Antrea native policy for L7Protocols (HTTP only) to be used with Ports/Protocols, only supports Allow, and not used with toServices. Add UT. Signed-off-by: Qiyue Yao <[email protected]>
This PR add support for L7 Antrea native NetworkPolicy in the controller side.
L7Protocols
to agent when processing ClusterNetworkPolicy and AntreaNetworkPolicy.L7Protocols
is only used withAllow
action, not used withtoServices
. WhenHTTP
is set, then L4Protocol is onlyTCP
or unset, and not withIGMP
orICMP
.