Skip to content

Commit

Permalink
Enhance ACNP applied to NodePort Service
Browse files Browse the repository at this point in the history
Signed-off-by: graysonwu <[email protected]>
  • Loading branch information
GraysonWu committed Sep 30, 2022
1 parent e7486d5 commit bdf6c87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/agent/openflow/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,7 @@ func (f *featureNetworkPolicy) ingressClassifierFlows() []binding.Flow {
Action().GotoTable(IngressMetricTable.GetID()).
Done(),
}
if f.proxyAll {
if f.enableAntreaPolicy && f.proxyAll {
// This generates the flow to match the NodePort Service packets and forward them to AntreaPolicyIngressRuleTable.
// Policies applied on NodePort Service will be enforced in AntreaPolicyIngressRuleTable.
flows = append(flows, IngressSecurityClassifierTable.ofTable.BuildFlow(priorityNormal+1).
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/antreapolicy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3734,7 +3734,7 @@ func testACNPNodePortServiceSupport(t *testing.T, data *TestData) {
testcases := []podToAddrTestStep{
{
Pod(fmt.Sprintf("%s/%s", data.testNamespace, clientName)),
nodeIP(1),
nodeIP(0),
svc1.Spec.Ports[0].NodePort,
Rejected,
},
Expand Down

0 comments on commit bdf6c87

Please sign in to comment.