Skip to content
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

NETOBSERV-1050 & NETOBSERV-1065 Transport field in IPFIX exporter not working #351

Merged
merged 2 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/samples/flows_v1beta1_flowcollector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ spec:
# ipfix:
# targetHost: "ipfix-collector.ipfix.svc.cluster.local"
# targetPort: 4739
# transport: tcp or udp (optional - defaults to tcp)
# transport: TCP or UDP (optional - defaults to TCP)
11 changes: 10 additions & 1 deletion controllers/flowlogspipeline/flp_common_objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ func createIPFIXWriteStage(name string, spec *flowslatest.FlowCollectorIPFIXRece
return fromStage.WriteIpfix(name, api.WriteIpfix{
TargetHost: spec.TargetHost,
TargetPort: spec.TargetPort,
Transport: spec.Transport,
Transport: getIPFIXTransport(spec.Transport),
EnterpriseID: 2,
})
}
Expand All @@ -573,6 +573,15 @@ func getKafkaTLS(tls *flowslatest.ClientTLS) *api.ClientTLS {
return nil
}

func getIPFIXTransport(transport string) string {
switch transport {
case "UDP":
return "udp"
default:
return "tcp" //always fallback on tcp
}
}

// returns a configmap with a digest of its configuration contents, which will be used to
// detect any configuration change
func (b *builder) configMap(stages []config.Stage, parameters []config.StageParam) (*corev1.ConfigMap, string, error) {
Expand Down
2 changes: 1 addition & 1 deletion controllers/flowlogspipeline/flp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ func TestPipelineWithExporter(t *testing.T) {
IPFIX: flowslatest.FlowCollectorIPFIXReceiver{
TargetHost: "ipfix-receiver-test",
TargetPort: 9999,
Transport: "tcp",
Transport: "TCP",
},
})

Expand Down