Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Antonin Bas <[email protected]>
  • Loading branch information
antoninbas committed Jan 17, 2025
1 parent ee71e07 commit 6f4d437
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
7 changes: 4 additions & 3 deletions build/charts/flow-aggregator/conf/flow-aggregator.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Mode in which to run the flow aggregator. Must be one of "Aggregate" (flow records received
# from source and destination are aggregated and sent as one flow record) or "Proxy" (flow records
# are enhanced with some additional information, then sent directly without buffering or aggregation).
# Mode in which to run the flow aggregator. Must be one of "Aggregate" or "Proxy". In Aggregate
# mode, flow records received from source and destination are aggregated and sent as one flow
# record. In Proxy mode, flow records are enhanced with some additional information, then sent
# directly without buffering or aggregation.
mode: {{ .Values.mode }}

# Provide the active flow record timeout as a duration string. This determines
Expand Down
7 changes: 4 additions & 3 deletions build/charts/flow-aggregator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ image:
pullPolicy: "IfNotPresent"
tag: ""

# -- Mode in which to run the flow aggregator. Must be one of "Aggregate" (flow records received
# from source and destination are aggregated and sent as one flow record) or "Proxy" (flow records
# are enhanced with some additional information, then sent directly without buffering or aggregation).
# -- Mode in which to run the flow aggregator. Must be one of "Aggregate" or "Proxy". In Aggregate
# mode, flow records received from source and destination are aggregated and sent as one flow
# record. In Proxy mode, flow records are enhanced with some additional information, then sent
# directly without buffering or aggregation.
mode: "Aggregate"
# -- Provide the active flow record timeout as a duration string.
# Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
Expand Down
7 changes: 4 additions & 3 deletions build/yamls/flow-aggregator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ subjects:
apiVersion: v1
data:
flow-aggregator.conf: |
# Mode in which to run the flow aggregator. Must be one of "Aggregate" (flow records received
# from source and destination are aggregated and sent as one flow record) or "Proxy" (flow records
# are enhanced with some additional information, then sent directly without buffering or aggregation).
# Mode in which to run the flow aggregator. Must be one of "Aggregate" or "Proxy". In Aggregate
# mode, flow records received from source and destination are aggregated and sent as one flow
# record. In Proxy mode, flow records are enhanced with some additional information, then sent
# directly without buffering or aggregation.
mode: Aggregate
# Provide the active flow record timeout as a duration string. This determines
Expand Down
7 changes: 6 additions & 1 deletion pkg/config/flowaggregator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ const (
type AggregatorMode string

const (
// In Aggregate mode, flow records received from source and destination are aggregated and
// sent as one flow record.
AggregatorModeAggregate AggregatorMode = "Aggregate"
AggregatorModeProxy AggregatorMode = "Proxy"
// In Proxy mode, flow records are enhanced with some additional information, then sent
// directly without buffering or aggregation.
AggregatorModeProxy AggregatorMode = "Proxy"
)

type FlowAggregatorConfig struct {
// Mode in which to run the flow aggregator. Must be one of "Aggregate" or "Proxy".
Mode AggregatorMode `yaml:"mode,omitempty"`
// Provide the active flow record timeout as a duration string. This determines
// how often the flow aggregator exports the active flow records to the flow
Expand Down
2 changes: 1 addition & 1 deletion pkg/flowaggregator/flowaggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ func (fa *flowAggregator) proxyRecord(record ipfixentities.Record, obsDomainID u
destinationAddress = destinationIPv6Address
default:
// All other cases are invalid.
return fmt.Errorf("invalid format for record: source and destination must be present and IPv4 / IPv6 fields are mutually-exclusive")
return fmt.Errorf("invalid format for record: source and destination must be present and IPv4 / IPv6 fields are mutually exclusive")
}
startTime, err := fa.getRecordStartTime(record)
if err != nil {
Expand Down

0 comments on commit 6f4d437

Please sign in to comment.