Skip to content

Commit

Permalink
Update flp dependency and update code due to breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierCazade committed Feb 9, 2024
1 parent 93e7811 commit 05be1ec
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 53 deletions.
28 changes: 20 additions & 8 deletions controllers/flp/flp_pipeline_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func newPipelineBuilder(
}
}

const openshiftNamespacesPrefixes = "openshift"

func (b *PipelineBuilder) AddProcessorStages() error {
lastStage := *b.PipelineBuilderStage
lastStage = b.addTransformFilter(lastStage)
Expand All @@ -57,17 +59,17 @@ func (b *PipelineBuilder) AddProcessorStages() error {
// enrich stage (transform) configuration
enrichedStage := lastStage.TransformNetwork("enrich", api.TransformNetwork{
Rules: api.NetworkTransformRules{{
Input: "SrcAddr",
Output: "SrcK8S",
Type: api.AddKubernetesRuleType,
Type: api.AddKubernetesRuleType,
Kubernetes: &api.K8sRule{
Input: "SrcAddr",
Output: "SrcK8S",
AddZone: addZone,
},
}, {
Input: "DstAddr",
Output: "DstK8S",
Type: api.AddKubernetesRuleType,
Type: api.AddKubernetesRuleType,
Kubernetes: &api.K8sRule{
Input: "DstAddr",
Output: "DstK8S",
AddZone: addZone,
},
}, {
Expand All @@ -79,8 +81,18 @@ func (b *PipelineBuilder) AddProcessorStages() error {
"SrcAddr",
"DstAddr",
},
Output: "K8S_FlowLayer",
InfraPrefix: b.desired.Namespace,
Output: "K8S_FlowLayer",
InfraPrefixes: []string{b.desired.Namespace, openshiftNamespacesPrefixes},
InfraRefs: []api.K8sReference{
{
Name: "kubernetes",
Namespace: "default",
},
{
Name: "openshift",
Namespace: "default",
},
},
},
}},
DirectionInfo: api.NetworkTransformDirectionInfo{
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ require (
)

replace github.com/prometheus/common v0.46.0 => github.com/netobserv/prometheus-common v0.46.0-netobserv

replace github.com/netobserv/flowlogs-pipeline v0.1.11-0.20240125165124-4289f5a17934 => github.com/OlivierCazade/flowlogs-pipeline v0.0.2-0.20240202153633-a34a92595834
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/OlivierCazade/flowlogs-pipeline v0.0.2-0.20240202153633-a34a92595834 h1:n2tD82BulV+TuOEYEAEjnYT2fA10+7eVZizZU3xCblc=
github.com/OlivierCazade/flowlogs-pipeline v0.0.2-0.20240202153633-a34a92595834/go.mod h1:iXyrdjKesbiZeLC+mT2ma8eFXlrMqRj/o3aOnBV3YAM=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
Expand Down Expand Up @@ -151,8 +153,6 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/netobserv/flowlogs-pipeline v0.1.11-0.20240125165124-4289f5a17934 h1:vMJ6tEETHl81Lbzmvs7z7I7PgvyC6WEzlJym2zSWMpQ=
github.com/netobserv/flowlogs-pipeline v0.1.11-0.20240125165124-4289f5a17934/go.mod h1:Hfcqa5PFrELNp1B4M9e2+rG3226uOiKMi8KEOYBY0ow=
github.com/netobserv/prometheus-common v0.46.0-netobserv h1:gpnbXZtSWBauwlSm0aC//mAwAUIvblW6xqNV4mnY2mE=
github.com/netobserv/prometheus-common v0.46.0-netobserv/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
Expand Down
33 changes: 18 additions & 15 deletions vendor/github.com/netobserv/flowlogs-pipeline/pkg/api/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ github.com/munnerz/goautoneg
# github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
## explicit
github.com/mwitkow/go-conntrack
# github.com/netobserv/flowlogs-pipeline v0.1.11-0.20240125165124-4289f5a17934
# github.com/netobserv/flowlogs-pipeline v0.1.11-0.20240125165124-4289f5a17934 => github.com/OlivierCazade/flowlogs-pipeline v0.0.2-0.20240202153633-a34a92595834
## explicit; go 1.20
github.com/netobserv/flowlogs-pipeline/pkg/api
github.com/netobserv/flowlogs-pipeline/pkg/config
Expand Down

0 comments on commit 05be1ec

Please sign in to comment.