-
Notifications
You must be signed in to change notification settings - Fork 22
NETOBSERV-2227: UDN adjustments, and auto-detect filters #846
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,22 +124,6 @@ export const NetflowTraffic: React.FC<NetflowTrafficProps> = ({ | |
| return model.config.features.includes('pktDrop'); | ||
| }, [model.config.features]); | ||
|
|
||
| const isUdn = React.useCallback(() => { | ||
| return model.config.features.includes('udnMapping'); | ||
| }, [model.config.features]); | ||
|
|
||
| const isPktXlat = React.useCallback(() => { | ||
| return model.config.features.includes('packetTranslation'); | ||
| }, [model.config.features]); | ||
|
|
||
| const isNetEvents = React.useCallback(() => { | ||
| return model.config.features.includes('networkEvents'); | ||
| }, [model.config.features]); | ||
|
|
||
| const isIPSec = React.useCallback(() => { | ||
| return model.config.features.includes('ipsec'); | ||
| }, [model.config.features]); | ||
|
|
||
| const isPromOnly = React.useCallback(() => { | ||
| return !allowLoki() || model.dataSource === 'prom'; | ||
| }, [allowLoki, model.dataSource]); | ||
|
|
@@ -159,14 +143,6 @@ export const NetflowTraffic: React.FC<NetflowTrafficProps> = ({ | |
| [model.config.promLabels, isPromOnly] | ||
| ); | ||
|
|
||
| const isMultiCluster = React.useCallback(() => { | ||
| return isPromOnly() ? dataSourceHasLabels(['K8S_ClusterName']) : model.config.features.includes('multiCluster'); | ||
| }, [model.config.features, dataSourceHasLabels, isPromOnly]); | ||
|
|
||
| const isZones = React.useCallback(() => { | ||
| return isPromOnly() ? dataSourceHasLabels(['SrcK8S_Zone', 'DstK8S_Zone']) : model.config.features.includes('zones'); | ||
| }, [model.config.features, dataSourceHasLabels, isPromOnly]); | ||
|
|
||
| const getAvailableScopes = React.useCallback(() => { | ||
| return model.config.scopes.filter(sc => { | ||
| if (sc.feature) { | ||
|
|
@@ -219,22 +195,14 @@ export const NetflowTraffic: React.FC<NetflowTrafficProps> = ({ | |
| }, [getAvailableColumns]); | ||
|
|
||
| const getFilterDefs = React.useCallback(() => { | ||
| return getFilterDefinitions(model.config.filters, model.config.columns, t).filter( | ||
| fd => | ||
| (isMultiCluster() || fd.id !== 'cluster_name') && | ||
| (isZones() || !fd.id.endsWith('_zone')) && | ||
| (isConnectionTracking() || fd.id !== 'id') && | ||
| (isDNSTracking() || !fd.id.startsWith('dns_')) && | ||
| (isPktDrop() || !fd.id.startsWith('pkt_drop_')) && | ||
| (isFlowRTT() || fd.id !== 'time_flow_rtt') && | ||
| (isUdn() || fd.id !== 'udns') && | ||
| (isPktXlat() || !fd.id.startsWith('xlat_')) && | ||
| (isNetEvents() || fd.id !== 'network_events') && | ||
| (!isPromOnly() || checkFilterAvailable(fd, model.config.promLabels)) && | ||
| (isIPSec() || !fd.id.startsWith('ipsec_')) | ||
| ); | ||
| return getFilterDefinitions(model.config.filters, model.config.columns, t).filter(fd => { | ||
| if (fd.id === 'id') { | ||
| return isConnectionTracking(); | ||
| } | ||
| return checkFilterAvailable(fd, model.config, model.dataSource); | ||
| }); | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [model.config.columns, model.config.filters, model.config.promLabels, isPromOnly]); | ||
| }, [model.config, model.dataSource]); | ||
|
Comment on lines
+198
to
+205
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Others filters seems to work properly 👌 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did you take the operator PR too? The issue with drops is supposed to be fixed from the operator config There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was using it yes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the operator generated image was prior to this commit, I guess you used that old one; just triggered a new one |
||
|
|
||
| const getQuickFilters = React.useCallback( | ||
| (c: Config = model.config) => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,5 +7,4 @@ export interface FieldConfig { | |
| type: FieldType; | ||
| format?: FieldFormat; | ||
| description: string; | ||
| filter?: string; | ||
| } | ||



There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not showing
n/agreyed out for empty ones ?Currently it's empty. That feels strange compared to other fields:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 6d8cec6