Skip to content

Commit

Permalink
Fix that TrafficControlTable is always created by default (#4642)
Browse files Browse the repository at this point in the history
For feature NetworkPolicy in flexible pipeline, TrafficControlTable
should be created when L7 NetworkPolicy is enabled since it is used
by L7 NetworkPolicy, and TrafficControlTable shouldn't be created by
default when L7 NetworkPolicy is disabled.

This PR also refines some unit test code.

Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
  • Loading branch information
hongliangl authored Feb 21, 2023
1 parent a164765 commit 2f54131
Show file tree
Hide file tree
Showing 6 changed files with 370 additions and 131 deletions.
52 changes: 28 additions & 24 deletions pkg/agent/openflow/client_test.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/agent/openflow/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func (f *featureNetworkPolicy) getRequiredTables() []*Table {
AntreaPolicyEgressRuleTable,
AntreaPolicyIngressRuleTable,
)
if f.nodeType == config.K8sNode {
if f.enableL7NetworkPolicy {
tables = append(tables, TrafficControlTable) // For L7 NetworkPolicy.
}
if f.enableMulticast {
Expand Down
Loading

0 comments on commit 2f54131

Please sign in to comment.