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

Rename Source and Destination Service to Identity #674

Merged
merged 1 commit into from
Oct 11, 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
4 changes: 2 additions & 2 deletions src/components/FlowsTable/Cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const Cell = memo<CellProps>(function FlowsTableCell(props) {
case Column.SrcIp: {
return <div className={css.cell}>{props.flow.sourceIp}</div>;
}
case Column.SrcService: {
case Column.SrcIdentity: {
const appName = props.flow.sourceIdentityName ?? 'No app name';
const subtitle = props.flow.sourceNamespace ? (
<span className={css.subtitle}>{props.flow.sourceNamespace}</span>
Expand All @@ -55,7 +55,7 @@ export const Cell = memo<CellProps>(function FlowsTableCell(props) {
case Column.DstIp: {
return <div className={css.cell}>{props.flow.destinationIp}</div>;
}
case Column.DstService: {
case Column.DstIdentity: {
const appName = props.flow.destinationDns
? props.flow.destinationDns
: props.flow.destinationIdentityName ?? '—';
Expand Down
8 changes: 4 additions & 4 deletions src/components/FlowsTable/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ export const Header = memo<CommonProps>(function FlowsTableHeader(props) {
{props.visibleColumns.has(Column.SrcIp) && (
<div className={css.cell}>{getColumnLabel(Column.SrcIp)}</div>
)}
{props.visibleColumns.has(Column.SrcService) && (
<div className={css.cell}>{getColumnLabel(Column.SrcService)}</div>
{props.visibleColumns.has(Column.SrcIdentity) && (
<div className={css.cell}>{getColumnLabel(Column.SrcIdentity)}</div>
)}
{props.visibleColumns.has(Column.DstPod) && (
<div className={css.cell}>{getColumnLabel(Column.DstPod)}</div>
)}
{props.visibleColumns.has(Column.DstIp) && (
<div className={css.cell}>{getColumnLabel(Column.DstIp)}</div>
)}
{props.visibleColumns.has(Column.DstService) && (
<div className={css.cell}>{getColumnLabel(Column.DstService)}</div>
{props.visibleColumns.has(Column.DstIdentity) && (
<div className={css.cell}>{getColumnLabel(Column.DstIdentity)}</div>
)}
{props.visibleColumns.has(Column.DstPort) && (
<div className={classnames(css.cell, css.dstPort)}>
Expand Down
8 changes: 4 additions & 4 deletions src/components/FlowsTable/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ export const Row = memo<RowProps>(function FlowsTableRow(props) {
{props.visibleColumns.has(Column.SrcIp) && (
<Cell flow={props.flow} kind={Column.SrcIp} />
)}
{props.visibleColumns.has(Column.SrcService) && (
<Cell flow={props.flow} kind={Column.SrcService} />
{props.visibleColumns.has(Column.SrcIdentity) && (
<Cell flow={props.flow} kind={Column.SrcIdentity} />
)}
{props.visibleColumns.has(Column.DstPod) && (
<Cell flow={props.flow} kind={Column.DstPod} />
)}
{props.visibleColumns.has(Column.DstIp) && (
<Cell flow={props.flow} kind={Column.DstIp} />
)}
{props.visibleColumns.has(Column.DstService) && (
<Cell flow={props.flow} kind={Column.DstService} />
{props.visibleColumns.has(Column.DstIdentity) && (
<Cell flow={props.flow} kind={Column.DstIdentity} />
)}
{props.visibleColumns.has(Column.DstPort) && (
<Cell flow={props.flow} kind={Column.DstPort} />
Expand Down
8 changes: 4 additions & 4 deletions src/components/FlowsTable/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export enum Column {
Auth = 'Authentication',
SrcPod = 'Source Pod',
SrcIp = 'Source IP',
SrcService = 'Source Service',
SrcIdentity = 'Source Identity',
DstPod = 'Destination Pod',
DstIp = 'Destination IP',
DstService = 'Destination Service',
DstIdentity = 'Destination Identity',
DstPort = 'Destination Port',
L7Info = 'L7 info',
Verdict = 'Verdict',
Expand All @@ -34,8 +34,8 @@ export const getColumnKey = (col: Column): ColumnKey => {
};

export const defaultVisibleColumns = new Set<Column>([
Column.SrcService,
Column.DstService,
Column.SrcIdentity,
Column.DstIdentity,
Column.DstPort,
Column.L7Info,
Column.Verdict,
Expand Down
4 changes: 2 additions & 2 deletions src/storage/local/__tests__/store-restore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ describe('consistency tests for setItem / getItem', () => {
const getItem = jest.spyOn(Storage.prototype, 'getItem');
const setItem = jest.spyOn(Storage.prototype, 'setItem');

const arr = [Column.SrcService];
const arr = [Column.SrcIdentity];
saveFlowsTableVisibleColumns(new Set(arr));

expect(setItem.mock.calls.length).toBe(1);
expect(setItem.mock.calls[0][1]).toBe(JSON.stringify(arr));

const data = getFlowsTableVisibleColumns();
expect(data).toEqual(new Set([Column.SrcService]));
expect(data).toEqual(new Set([Column.SrcIdentity]));
});

test('flows table visible columns 3', () => {
Expand Down
Loading