diff --git a/controllers/constants/constants.go b/controllers/constants/constants.go index 98a2f79b5..2cb1ff06c 100644 --- a/controllers/constants/constants.go +++ b/controllers/constants/constants.go @@ -34,6 +34,6 @@ const ( EndConnectionType = "endConnection" ) -var LokiIndexFields = []string{"SrcK8S_Namespace", "SrcK8S_OwnerName", "DstK8S_Namespace", "DstK8S_OwnerName", "FlowDirection"} +var LokiIndexFields = []string{"SrcK8S_Namespace", "SrcK8S_OwnerName", "SrcK8S_Type", "DstK8S_Namespace", "DstK8S_OwnerName", "DstK8S_Type", "FlowDirection", "Duplicate"} var LokiConnectionIndexFields = []string{"_RecordType"} var FlowCollectorName = types.NamespacedName{Name: "cluster"} diff --git a/controllers/flowlogspipeline/flp_common_objects.go b/controllers/flowlogspipeline/flp_common_objects.go index e184ad399..13695de68 100644 --- a/controllers/flowlogspipeline/flp_common_objects.go +++ b/controllers/flowlogspipeline/flp_common_objects.go @@ -540,7 +540,6 @@ func (b *builder) addConnectionTracking(indexFields []string, lastStage config.P SwapAB: true, }, }) - } return indexFields, lastStage } diff --git a/controllers/flowlogspipeline/flp_test.go b/controllers/flowlogspipeline/flp_test.go index bd070ed22..368a8d690 100644 --- a/controllers/flowlogspipeline/flp_test.go +++ b/controllers/flowlogspipeline/flp_test.go @@ -630,7 +630,17 @@ func TestConfigMapShouldDeserializeAsJSON(t *testing.T) { assert.Equal(loki.MaxBackoff.Duration.String(), lokiCfg.MaxBackoff) assert.EqualValues(*loki.MaxRetries, lokiCfg.MaxRetries) assert.EqualValues(loki.BatchSize, lokiCfg.BatchSize) - assert.EqualValues([]string{"SrcK8S_Namespace", "SrcK8S_OwnerName", "DstK8S_Namespace", "DstK8S_OwnerName", "FlowDirection", "_RecordType"}, lokiCfg.Labels) + assert.EqualValues([]string{ + "SrcK8S_Namespace", + "SrcK8S_OwnerName", + "SrcK8S_Type", + "DstK8S_Namespace", + "DstK8S_OwnerName", + "DstK8S_Type", + "FlowDirection", + "Duplicate", + "_RecordType", + }, lokiCfg.Labels) assert.Equal(`{app="netobserv-flowcollector"}`, fmt.Sprintf("%v", lokiCfg.StaticLabels)) assert.Equal(cfg.Processor.Metrics.Server.Port, int32(decoded.MetricsSettings.Port))