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

topology: more internals #150

Merged
merged 1 commit into from
Nov 13, 2024
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
9 changes: 8 additions & 1 deletion src/components/PolicyTopologyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
configScript.innerHTML = script;
document.head.appendChild(configScript);

return (window as any).kuadrant_config || defaultConfig;

Check warning on line 69 in src/components/PolicyTopologyPage.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
} catch (error) {
console.error('Error loading config.js:', error);
return defaultConfig;
Expand All @@ -78,12 +78,12 @@
};

// Convert DOT graph to PatternFly node/edge models
const parseDotToModel = (dotString: string): { nodes: any[]; edges: any[] } => {

Check warning on line 81 in src/components/PolicyTopologyPage.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type

Check warning on line 81 in src/components/PolicyTopologyPage.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
try {
const graph = dot.read(dotString);
const nodes: any[] = [];

Check warning on line 84 in src/components/PolicyTopologyPage.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
const edges: any[] = [];

Check warning on line 85 in src/components/PolicyTopologyPage.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
const groups: any[] = [];

Check warning on line 86 in src/components/PolicyTopologyPage.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
const connectedNodeIds = new Set<string>();

const shapeMapping: { [key: string]: NodeShape } = {
Expand All @@ -108,6 +108,7 @@
'EnvoyFilter',
'GatewayClass',
'DNSRecord',
'AuthConfig',
]);

// kinds for unassociated policies - these will be grouped
Expand All @@ -119,7 +120,13 @@
]);

// kinds for Kuadrant internals - these will be grouped also
const kuadrantInternals = new Set(['ConfigMap', 'Kuadrant', 'Limitador', 'Authorino']);
const kuadrantInternals = new Set([
'ConfigMap',
'Kuadrant',
'Limitador',
'Authorino',
'ConsolePlugin',
]);

// reconnect edges for excluded, connected nodes (e.g. GatewayClass)
const rewireExcludedEdges = (graph, sourceNodeId, targetNodeId) => {
Expand Down Expand Up @@ -227,7 +234,7 @@
}
};

const CustomNode: React.FC<any> = ({

Check warning on line 237 in src/components/PolicyTopologyPage.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
element,
onSelect,
selected,
Expand Down Expand Up @@ -338,7 +345,7 @@
window.location.href = url;
};

const customLayoutFactory = (type: string, graph: any): any => {

Check warning on line 348 in src/components/PolicyTopologyPage.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type

Check warning on line 348 in src/components/PolicyTopologyPage.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
return new DagreLayout(graph, {
rankdir: 'TB',
nodesep: 20,
Expand Down
1 change: 1 addition & 0 deletions src/utils/latest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const resourceGVKMapping: { [key: string]: { group: string; version: string; kin
Authorino: { group: 'operator.authorino.kuadrant.io', version: 'v1beta1', kind: 'Authorino' },
Limitador: { group: 'limitador.kuadrant.io', version: 'v1alpha1', kind: 'Limitador' },
Kuadrant: { group: 'kuadrant.io', version: 'v1beta1', kind: 'Kuadrant' },
ConsolePlugin: { group: 'console.openshift.io', version: 'v1', kind: 'ConsolePlugin' },
};

export default resourceGVKMapping;
Loading