Skip to content

Commit c559a13

Browse files
jpinsonneaujotak
andauthored
NETOBSERV-1904 add configs for UDNs (#909)
* add configs for UDNs * fix tests * Update controllers/consoleplugin/config/static-frontend-config.yaml Co-authored-by: Joel Takvorian <[email protected]> --------- Co-authored-by: Joel Takvorian <[email protected]>
1 parent 3108dfe commit c559a13

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

controllers/consoleplugin/config/static-frontend-config.yaml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,13 @@ columns:
443443
field: Interfaces
444444
default: false
445445
width: 15
446+
- id: UDN
447+
name: User Defined Network
448+
tooltip: The user defined network identifier.
449+
field: UdnId
450+
filter: udn
451+
default: false
452+
width: 15
446453
- id: Bytes
447454
name: Bytes
448455
tooltip: The total aggregated number of bytes.
@@ -944,6 +951,10 @@ filters:
944951
component: autocomplete
945952
placeholder: 'E.g: Ingress, Egress'
946953
hint: Specify the direction of the Flow observed at the network interface observation point.
954+
- id: udn
955+
name: User Defined Network
956+
component: autocomplete
957+
hint: Specify a user defined network name.
947958
- id: id
948959
name: Conversation Id
949960
component: text
@@ -1031,6 +1042,14 @@ scopes:
10311042
feature: multiCluster
10321043
filter: cluster_name
10331044
stepInto: zone
1045+
- id: udn
1046+
name: UDN
1047+
shortName: UDN
1048+
description: User Defined Network
1049+
labels:
1050+
- UdnId
1051+
filter: udn
1052+
stepInto: namespace
10341053
- id: zone
10351054
name: Zone
10361055
shortName: AZ
@@ -1053,9 +1072,12 @@ scopes:
10531072
- SrcK8S_HostName
10541073
- DstK8S_HostName
10551074
groups:
1056-
- clusters
1075+
- udns
10571076
- zones
1077+
- clusters
10581078
- clusters+zones
1079+
- clusters+udns
1080+
- udns+zones
10591081
filters:
10601082
- src_host_name
10611083
- dst_host_name
@@ -1074,6 +1096,9 @@ scopes:
10741096
- zones
10751097
- zones+hosts
10761098
- hosts
1099+
- udns
1100+
- udns+zones
1101+
- udns+hosts
10771102
filters:
10781103
- src_namespace
10791104
- dst_namespace
@@ -1100,6 +1125,10 @@ scopes:
11001125
- hosts
11011126
- hosts+namespaces
11021127
- namespaces
1128+
- udns
1129+
- udns+zones
1130+
- udns+hosts
1131+
- udns+namespaces
11031132
filters:
11041133
- src_owner_name
11051134
- dst_owner_name
@@ -1139,6 +1168,11 @@ scopes:
11391168
- namespaces
11401169
- namespaces+owners
11411170
- owners
1171+
- udns
1172+
- udns+zones
1173+
- udns+hosts
1174+
- udns+namespaces
1175+
- udns+owners
11421176
filters:
11431177
- src_resource
11441178
- dst_resource
@@ -1331,6 +1365,10 @@ fields:
13311365
- name: K8S_ClusterName
13321366
type: string
13331367
description: Cluster name or identifier
1368+
- name: UdnId
1369+
type: string
1370+
description: User Defined Network
1371+
lokiLabel: true
13341372
- name: _RecordType
13351373
type: string
13361374
description: "Type of record: 'flowLog' for regular flow logs, or 'newConnection', 'heartbeat', 'endConnection' for conversation tracking"

controllers/flp/flp_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ func TestConfigMapShouldDeserializeAsJSONWithLokiManual(t *testing.T) {
655655
"DstK8S_Type",
656656
"K8S_FlowLayer",
657657
"FlowDirection",
658+
"UdnId",
658659
"_RecordType",
659660
}, lokiCfg.Labels)
660661
assert.Equal(`{app="netobserv-flowcollector"}`, fmt.Sprintf("%v", lokiCfg.StaticLabels))
@@ -711,6 +712,7 @@ func TestConfigMapShouldDeserializeAsJSONWithLokiStack(t *testing.T) {
711712
"DstK8S_Type",
712713
"K8S_FlowLayer",
713714
"FlowDirection",
715+
"UdnId",
714716
"_RecordType",
715717
}, lokiCfg.Labels)
716718
assert.Equal(`{app="netobserv-flowcollector"}`, fmt.Sprintf("%v", lokiCfg.StaticLabels))

pkg/helper/loki/labels_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func TestDefaultLokiLabels(t *testing.T) {
2020
"DstK8S_Type",
2121
"K8S_FlowLayer",
2222
"FlowDirection",
23+
"UdnId",
2324
})
2425
}
2526

@@ -40,6 +41,7 @@ func TestAllLokiLabels(t *testing.T) {
4041
"DstK8S_Type",
4142
"K8S_FlowLayer",
4243
"FlowDirection",
44+
"UdnId",
4345
"_RecordType",
4446
"K8S_ClusterName",
4547
"SrcK8S_Zone",

pkg/helper/loki/loki-labels.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"DstK8S_OwnerName",
88
"DstK8S_Type",
99
"K8S_FlowLayer",
10-
"FlowDirection"
10+
"FlowDirection",
11+
"UdnId"
1112
],
1213
"conntrack": [
1314
"_RecordType"

0 commit comments

Comments
 (0)