Skip to content

Commit

Permalink
Enable SwapAB only when the feature flag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
ronensc committed Feb 20, 2023
1 parent 08c4bc5 commit 4e2d06f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/pipeline/extract/conntrack/conntrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (ct *conntrackImpl) Extract(flowLogs []config.GenericMap) []config.GenericM
builder := NewConnBuilder(ct.metrics)
conn = builder.
Hash(computedHash).
ShouldSwapAB(ct.shouldSwapAB(fl)).
ShouldSwapAB(ct.config.TCPFlags.SwapAB && ct.shouldSwapAB(fl)).
KeysFrom(fl, ct.config.KeyDefinition, ct.endpointAFields, ct.endpointBFields).
Aggregators(ct.aggregators).
Build()
Expand Down
4 changes: 2 additions & 2 deletions pkg/pipeline/extract/conntrack/conntrack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,8 @@ func TestSwapAB(t *testing.T) {
defaultUpdateConnectionInterval, defaultEndConnectionTimeout)
tcpFlagsFieldName := "TCPFlags"
conf.Extract.ConnTrack.TCPFlags = api.ConnTrackTCPFlags{
FieldName: tcpFlagsFieldName,
DetectEndConnection: true,
FieldName: tcpFlagsFieldName,
SwapAB: true,
}
ct, err := NewConnectionTrack(opMetrics, *conf, clk)
require.NoError(t, err)
Expand Down

0 comments on commit 4e2d06f

Please sign in to comment.