@skyhook-io/radar-app 1.19.0 → 1.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +5 -5
- package/src/App.tsx +37 -9
- package/src/api/application-evidence.ts +63 -0
- package/src/api/argoSync.test.ts +22 -0
- package/src/api/client.audit-gating.test.tsx +48 -0
- package/src/api/client.kueuePosition.test.ts +32 -0
- package/src/api/client.kueueQueueWorkloads.test.tsx +71 -0
- package/src/api/client.resource-identity.test.ts +3 -0
- package/src/api/client.resourceIssues.test.tsx +239 -0
- package/src/api/client.resourcePath.test.ts +3 -0
- package/src/api/client.ts +353 -64
- package/src/api/config.ts +21 -0
- package/src/api/diagnose.ts +4 -0
- package/src/api/helmInventory.test.tsx +108 -0
- package/src/api/radarFeatures.render.test.tsx +33 -1
- package/src/api/radarFeatures.test.ts +47 -0
- package/src/api/radarFeatures.ts +42 -1
- package/src/api/rbac.settled.test.tsx +42 -0
- package/src/api/rbac.test.ts +18 -0
- package/src/api/rbac.ts +37 -7
- package/src/api/traffic.ts +9 -4
- package/src/api/usage-data.fixtures.ts +3 -1
- package/src/api/usage-data.test.tsx +134 -0
- package/src/api/usage-data.ts +35 -7
- package/src/api/workloadPodsPolling.test.ts +26 -0
- package/src/components/CloudConnectFlow.test.tsx +86 -0
- package/src/components/CloudConnectFlow.tsx +65 -27
- package/src/components/CloudFunnelButton.test.tsx +140 -5
- package/src/components/CloudFunnelButton.tsx +50 -9
- package/src/components/ConnectionErrorView.test.tsx +34 -0
- package/src/components/ConnectionErrorView.tsx +35 -11
- package/src/components/ContextSwitcher.tsx +5 -2
- package/src/components/SwitchAwareConnectionError.test.tsx +43 -0
- package/src/components/SwitchAwareConnectionError.tsx +85 -0
- package/src/components/application-evidence/ApplicationEvidenceAction.flow.test.tsx +234 -0
- package/src/components/application-evidence/ApplicationEvidenceAction.test.tsx +144 -0
- package/src/components/application-evidence/ApplicationEvidenceAction.tsx +218 -0
- package/src/components/capacity/CapacityDemand.tsx +3 -2
- package/src/components/capacity/demandSummary.test.ts +38 -0
- package/src/components/capacity/shared.tsx +12 -1
- package/src/components/cost/ApplicationCostTab.tsx +4 -0
- package/src/components/cost/CostTrendChart.tsx +2 -0
- package/src/components/cost/WorkloadCostTab.tsx +4 -0
- package/src/components/cost/source.test.ts +5 -0
- package/src/components/cost/source.ts +11 -0
- package/src/components/curl/ServiceCurlAvailability.test.tsx +32 -0
- package/src/components/curl/ServiceCurlButton.tsx +2 -2
- package/src/components/diagnose/AIMarkdown.tsx +3 -0
- package/src/components/diagnose/AgentSetupNotice.test.tsx +17 -0
- package/src/components/diagnose/AgentSetupNotice.tsx +21 -3
- package/src/components/diagnose/ContinueInAgentButton.mounted.test.tsx +182 -0
- package/src/components/diagnose/ContinueInAgentButton.test.tsx +128 -0
- package/src/components/diagnose/ContinueInAgentButton.tsx +303 -0
- package/src/components/diagnose/DiagnoseContext.question.test.tsx +1 -1
- package/src/components/diagnose/DiagnoseContext.tsx +68 -2
- package/src/components/diagnose/DiagnoseSurface.tsx +58 -113
- package/src/components/diagnose/ExampleInvestigationLink.tsx +20 -0
- package/src/components/diagnose/Home.test.tsx +26 -0
- package/src/components/diagnose/Home.tsx +20 -1
- package/src/components/diagnose/InvestigationEvidenceSections.tsx +45 -22
- package/src/components/diagnose/InvestigationView.tsx +94 -26
- package/src/components/diagnose/LocalDiagnoseAction.history.test.tsx +450 -0
- package/src/components/diagnose/LocalDiagnoseAction.tsx +354 -35
- package/src/components/diagnose/NextStepJump.test.tsx +92 -0
- package/src/components/diagnose/NextStepJump.tsx +75 -0
- package/src/components/diagnose/QuestionComposer.tsx +8 -0
- package/src/components/diagnose/exampleInvestigation.events.json +191 -0
- package/src/components/diagnose/exampleInvestigation.loadFailure.test.tsx +94 -0
- package/src/components/diagnose/exampleInvestigation.test.tsx +248 -0
- package/src/components/diagnose/exampleInvestigation.ts +121 -0
- package/src/components/diagnose/investigationCase.test.tsx +50 -1
- package/src/components/diagnose/investigationEvidence/adapters/applicationFindings.test.ts +739 -0
- package/src/components/diagnose/investigationEvidence/adapters/coverage.test.tsx +72 -0
- package/src/components/diagnose/investigationEvidence/adapters/diagnose.ts +50 -2
- package/src/components/diagnose/investigationEvidence/adapters/helm.ts +51 -16
- package/src/components/diagnose/investigationEvidence/adapters/issues.ts +9 -0
- package/src/components/diagnose/investigationEvidence/adapters/listings.ts +34 -4
- package/src/components/diagnose/investigationEvidence/adapters/resource.ts +3 -2
- package/src/components/diagnose/investigationEvidence/builder.ts +30 -0
- package/src/components/diagnose/investigationEvidence/observations.ts +121 -2
- package/src/components/diagnose/investigationEvidence/projection.test.ts +85 -3
- package/src/components/diagnose/investigationEvidence/types.ts +5 -0
- package/src/components/diagnose/investigationState.ts +28 -0
- package/src/components/diagnose/lastInvestigation.test.ts +95 -0
- package/src/components/diagnose/lastInvestigation.ts +58 -0
- package/src/components/diagnose/launch.test.ts +125 -1
- package/src/components/diagnose/launch.ts +57 -10
- package/src/components/diagnose/toolCallLabel.test.ts +10 -4
- package/src/components/execution/BatchExecutionView.tsx +24 -11
- package/src/components/execution/JobSetAdmission.test.tsx +42 -0
- package/src/components/execution/JobSetAdmission.tsx +18 -3
- package/src/components/execution/JobSetMemberComparison.tsx +2 -1
- package/src/components/execution/runState.test.ts +14 -0
- package/src/components/execution/runState.ts +8 -0
- package/src/components/gitops/GitOpsView.rollbackGate.test.tsx +202 -0
- package/src/components/gitops/GitOpsView.syncRequest.test.tsx +369 -0
- package/src/components/gitops/GitOpsView.tsx +86 -17
- package/src/components/gitops/RemoteDestinationCloudHint.tsx +2 -3
- package/src/components/gitops/destination-toast.test.ts +1 -1
- package/src/components/gitops/destination-toast.ts +2 -2
- package/src/components/helm/HelmDrawerFrame.tsx +101 -0
- package/src/components/helm/HelmDrawerRouting.test.tsx +86 -0
- package/src/components/helm/HelmReleaseDrawer.tsx +23 -86
- package/src/components/helm/HelmView.tsx +213 -71
- package/src/components/helm/ObservedHelmNotice.tsx +146 -0
- package/src/components/helm/ObservedHelmRelease.test.tsx +261 -0
- package/src/components/helm/ObservedHelmReleaseDrawer.test.tsx +80 -0
- package/src/components/helm/ObservedHelmReleaseDrawer.tsx +228 -0
- package/src/components/helm/OwnedResources.tsx +4 -2
- package/src/components/home/ClusterHealthCard.restricted.test.tsx +76 -0
- package/src/components/home/ClusterHealthCard.tsx +28 -5
- package/src/components/home/HelmSummary.tsx +23 -4
- package/src/components/home/HelmSummary.unread.test.ts +16 -0
- package/src/components/home/HomeAgentBlock.test.tsx +31 -3
- package/src/components/home/HomeAgentBlock.tsx +20 -4
- package/src/components/home/HomeDiagramCard.tsx +47 -0
- package/src/components/home/HomeView.tsx +81 -41
- package/src/components/home/MCPSetupDialog.test.tsx +126 -10
- package/src/components/home/MCPSetupDialog.tsx +33 -5
- package/src/components/home/ProblemsPanel.investigate.test.tsx +171 -0
- package/src/components/home/ProblemsPanel.test.tsx +3 -1
- package/src/components/home/TopologyPreview.test.tsx +73 -0
- package/src/components/home/TopologyPreview.tsx +120 -233
- package/src/components/home/TrafficSummary.test.tsx +63 -0
- package/src/components/home/TrafficSummary.tsx +135 -138
- package/src/components/home/mcpToolCatalog.ts +67 -14
- package/src/components/issues/IssuesPane.test.ts +11 -0
- package/src/components/issues/IssuesPane.tsx +15 -5
- package/src/components/issues/uncheckedSources.test.ts +22 -1
- package/src/components/issues/uncheckedSources.ts +21 -0
- package/src/components/kueue/KueuePendingPosition.tsx +35 -0
- package/src/components/kueue/useRelatedObjects.test.tsx +219 -0
- package/src/components/kueue/useRelatedReads.test.ts +56 -0
- package/src/components/kueue/useRelatedReads.ts +205 -0
- package/src/components/logs/MultiPodLogsTab.test.tsx +93 -0
- package/src/components/logs/MultiPodLogsTab.tsx +120 -0
- package/src/components/logs/PodLogsUnavailable.test.tsx +18 -0
- package/src/components/logs/PodLogsUnavailable.tsx +21 -0
- package/src/components/logs/RayClusterLogsTab.reselect.test.tsx +67 -0
- package/src/components/logs/RayClusterLogsTab.test.tsx +167 -0
- package/src/components/logs/RayClusterLogsTab.tsx +109 -0
- package/src/components/logs/ScheduledWorkloadLogsViewer.tsx +3 -2
- package/src/components/logs/rayClusterPods.ts +32 -0
- package/src/components/outageSince.test.ts +21 -0
- package/src/components/outageSince.ts +10 -0
- package/src/components/resource/PrometheusCharts.overlays.test.ts +12 -0
- package/src/components/resource/PrometheusCharts.tsx +3 -40
- package/src/components/resources/crd/CRDSchemaTab.test.tsx +28 -0
- package/src/components/resources/crd/CRDSchemaTab.tsx +13 -0
- package/src/components/resources/crd/host.tsx +14 -0
- package/src/components/resources/renderers/CustomResourceDefinitionRenderer.test.tsx +27 -0
- package/src/components/resources/renderers/CustomResourceDefinitionRenderer.tsx +12 -0
- package/src/components/resources/renderers/JobAdmissionRenderers.test.tsx +4 -1
- package/src/components/resources/renderers/JobAdmissionRenderers.tsx +4 -3
- package/src/components/resources/renderers/KueueHostRenderers.test.tsx +117 -0
- package/src/components/resources/renderers/KueueQueueRenderers.test.tsx +97 -0
- package/src/components/resources/renderers/KueueQueueRenderers.tsx +139 -0
- package/src/components/resources/renderers/KueueWorkloadRenderer.test.tsx +7 -1
- package/src/components/resources/renderers/KueueWorkloadRenderer.tsx +47 -7
- package/src/components/resources/renderers/OpenTelemetryCollectorRenderer.test.tsx +67 -0
- package/src/components/resources/renderers/OpenTelemetryCollectorRenderer.tsx +31 -0
- package/src/components/resources/renderers/RayClusterRenderer.test.tsx +81 -3
- package/src/components/resources/renderers/RayClusterRenderer.tsx +19 -4
- package/src/components/resources/renderers/ServiceRenderer.test.tsx +15 -2
- package/src/components/resources/renderers/ServiceRenderer.tsx +1 -1
- package/src/components/resources/renderers/ValidatingAdmissionPolicyRenderer.test.tsx +160 -0
- package/src/components/resources/renderers/ValidatingAdmissionPolicyRenderer.tsx +128 -0
- package/src/components/traffic/TrafficView.tsx +3 -3
- package/src/components/ui/command-items-crd.test.tsx +23 -0
- package/src/components/ui/command-items.ts +2 -1
- package/src/components/useContextSwitchFlow.test.tsx +61 -0
- package/src/components/useContextSwitchFlow.tsx +21 -4
- package/src/components/whats-new/WhatsNew.test.ts +10 -3
- package/src/components/whats-new/WhatsNew.tsx +5 -1
- package/src/components/whats-new/WhatsNewDialog.test.tsx +17 -3
- package/src/components/whats-new/releaseNotes.ts +77 -4
- package/src/components/workload/RelatedFindingsSection.test.tsx +126 -0
- package/src/components/workload/RelatedFindingsSection.tsx +80 -0
- package/src/components/workload/WorkloadView.test.ts +10 -1
- package/src/components/workload/WorkloadView.tsx +85 -98
- package/src/components/workload/issueResourceOpener.test.ts +20 -0
- package/src/components/workload/issueResourceOpener.ts +17 -0
- package/src/context/ConnectionContext.tsx +133 -60
- package/src/context/ConnectionProvider.retry.test.tsx +176 -0
- package/src/context/ContextSwitchContext.tsx +14 -1
- package/src/context/DiagnoseCustomization.tsx +3 -0
- package/src/context/clusterConnected.ts +10 -0
- package/src/contexts/CapabilitiesContext.tsx +8 -4
- package/src/hooks/useElementSize.ts +30 -0
- package/src/hooks/useResolvedGitOpsOwner.test.ts +22 -0
- package/src/hooks/useResolvedGitOpsOwner.ts +6 -3
- package/src/integrations/resourceHost.test.tsx +1 -0
- package/src/integrations/resourceHost.ts +5 -1
- package/src/integrations/resourceHosts.test.tsx +21 -4
- package/src/integrations/resourceHosts.tsx +17 -0
- package/src/main.tsx +5 -0
- package/src/utils/related-findings.ts +46 -0
|
@@ -1,154 +1,151 @@
|
|
|
1
|
+
import { useId } from 'react'
|
|
1
2
|
import type { DashboardTrafficSummary } from '../../api/client'
|
|
2
|
-
import { Activity
|
|
3
|
+
import { Activity } from 'lucide-react'
|
|
4
|
+
import { useElementSize } from '../../hooks/useElementSize'
|
|
5
|
+
import { NAMESPACE_PALETTE } from '../../utils/traffic-colors'
|
|
6
|
+
import { HomeDiagramCard } from './HomeDiagramCard'
|
|
3
7
|
|
|
4
8
|
interface TrafficSummaryProps {
|
|
5
9
|
data: DashboardTrafficSummary | null
|
|
6
10
|
onNavigate: () => void
|
|
7
11
|
}
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
const SOURCE_NAMES: Record<string, string> = {
|
|
14
|
+
hubble: 'Hubble',
|
|
15
|
+
beyla: 'Beyla',
|
|
16
|
+
caretta: 'Caretta',
|
|
17
|
+
istio: 'Istio',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function trafficSourceName(source: string): string {
|
|
21
|
+
return SOURCE_NAMES[source] ?? source.charAt(0).toUpperCase() + source.slice(1)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// The drawing's height in its own units. Its width follows the card, up to a
|
|
25
|
+
// limit, so the picture fills a wide card instead of floating in the middle.
|
|
26
|
+
const SKETCH_H = 128
|
|
27
|
+
const SKETCH_MIN_W = 296
|
|
28
|
+
const SKETCH_MAX_W = 560
|
|
29
|
+
const NODE_W = 58
|
|
30
|
+
const NODE_H = 24
|
|
31
|
+
|
|
32
|
+
// Example namespaces shared with the Topology card's picture, coloured from the
|
|
33
|
+
// Traffic view's own palette.
|
|
34
|
+
const NAMESPACES = {
|
|
35
|
+
storefront: NAMESPACE_PALETTE[1],
|
|
36
|
+
payments: NAMESPACE_PALETTE[3],
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
type Column = 0 | 1 | 2 | 3
|
|
40
|
+
interface SketchNode { col: Column; y: number; name: string; namespace: keyof typeof NAMESPACES; port: number }
|
|
41
|
+
|
|
42
|
+
const NODES: Record<string, SketchNode> = {
|
|
43
|
+
frontend: { col: 1, y: 64, name: 'frontend', namespace: 'storefront', port: 8080 },
|
|
44
|
+
cart: { col: 2, y: 22, name: 'cart', namespace: 'storefront', port: 7070 },
|
|
45
|
+
catalog: { col: 2, y: 64, name: 'catalog', namespace: 'storefront', port: 3550 },
|
|
46
|
+
checkout: { col: 2, y: 106, name: 'checkout', namespace: 'payments', port: 5050 },
|
|
47
|
+
redis: { col: 3, y: 22, name: 'redis', namespace: 'storefront', port: 6379 },
|
|
48
|
+
payment: { col: 3, y: 106, name: 'payment', namespace: 'payments', port: 50051 },
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const EDGES: [from: string, to: string, count: number][] = [
|
|
52
|
+
['internet', 'frontend', 182],
|
|
53
|
+
['frontend', 'cart', 72],
|
|
54
|
+
['frontend', 'catalog', 32],
|
|
55
|
+
['frontend', 'checkout', 28],
|
|
56
|
+
['cart', 'redis', 49],
|
|
57
|
+
['checkout', 'payment', 10],
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
const INTERNET = { x: 4, y: 64, w: 44 }
|
|
61
|
+
|
|
62
|
+
// A right-angled route with rounded corners, the shape the Traffic view draws.
|
|
63
|
+
function route(x1: number, y1: number, x2: number, y2: number): string {
|
|
64
|
+
if (y1 === y2) return `M ${x1} ${y1} H ${x2}`
|
|
65
|
+
const mx = (x1 + x2) / 2
|
|
66
|
+
const r = Math.min(3, Math.abs(y2 - y1) / 2)
|
|
67
|
+
const dy = y2 > y1 ? r : -r
|
|
68
|
+
return `M ${x1} ${y1} H ${mx - r} Q ${mx} ${y1} ${mx} ${y1 + dy} V ${y2 - dy} Q ${mx} ${y2} ${mx + r} ${y2} H ${x2}`
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// A static picture of what Live Traffic draws: services as boxes in their
|
|
72
|
+
// namespace's colour, reached on a port, with connection counts on the lines.
|
|
73
|
+
// It is a hint at the view, not this cluster's traffic, so it never moves and
|
|
74
|
+
// carries no health colour.
|
|
75
|
+
function TrafficSketch() {
|
|
76
|
+
const arrow = `${useId()}-arrow`
|
|
77
|
+
const [ref, size] = useElementSize<HTMLDivElement>({ width: SKETCH_MIN_W, height: SKETCH_H })
|
|
78
|
+
const width = Math.min(SKETCH_MAX_W, Math.max(SKETCH_MIN_W, (SKETCH_H * size.width) / size.height))
|
|
79
|
+
// Extra width spreads the columns apart rather than stretching the boxes.
|
|
80
|
+
const extra = width - SKETCH_MIN_W
|
|
81
|
+
const colX = (c: Column) => [66, 146, 226][c - 1] + (extra * c) / 3
|
|
82
|
+
|
|
83
|
+
const anchor = (key: string) => key === 'internet'
|
|
84
|
+
? { left: INTERNET.x, right: INTERNET.x + INTERNET.w, y: INTERNET.y }
|
|
85
|
+
: { left: colX(NODES[key].col), right: colX(NODES[key].col) + NODE_W, y: NODES[key].y }
|
|
27
86
|
|
|
28
87
|
return (
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
<line x1="86" y1="69" x2="108" y2="76" stroke={ec} strokeWidth="1.2" opacity="0.35" markerEnd="url(#trf-a2)" />
|
|
76
|
-
<rect x="110" y="70" width="28" height="12" rx="3" fill={blue} opacity="0.7" />
|
|
77
|
-
|
|
78
|
-
{/* === Branch 5: purple service (bottom) === */}
|
|
79
|
-
<line x1="39" y1="87" x2="56" y2="87" stroke={ec} strokeWidth="1.3" opacity="0.35" markerEnd="url(#trf-a)" />
|
|
80
|
-
<rect x="58" y="81" width="28" height="12" rx="3" fill={purple} opacity="0.85" />
|
|
81
|
-
<circle cx="62" cy="87" r="1.5" fill={green} opacity="0.9" />
|
|
82
|
-
|
|
83
|
-
{/* === Branch 6: small red service === */}
|
|
84
|
-
<line x1="39" y1="103" x2="56" y2="103" stroke={ec} strokeWidth="1" opacity="0.3" markerEnd="url(#trf-a)" />
|
|
85
|
-
<rect x="58" y="97" width="28" height="12" rx="3" fill={red} opacity="0.65" />
|
|
86
|
-
<circle cx="62" cy="103" r="1.5" fill={red} opacity="0.9" />
|
|
87
|
-
</svg>
|
|
88
|
+
<div ref={ref} className="w-full h-full">
|
|
89
|
+
<svg viewBox={`0 0 ${width} ${SKETCH_H}`} className="w-full h-full" preserveAspectRatio="xMidYMid meet" aria-hidden="true">
|
|
90
|
+
<defs>
|
|
91
|
+
<marker id={arrow} viewBox="0 0 8 6" refX="7" refY="3" markerWidth="5" markerHeight="4" orient="auto">
|
|
92
|
+
<path d="M 0 0 L 8 3 L 0 6 z" fill="var(--text-tertiary)" />
|
|
93
|
+
</marker>
|
|
94
|
+
</defs>
|
|
95
|
+
|
|
96
|
+
{EDGES.map(([from, to, count]) => {
|
|
97
|
+
const a = anchor(from)
|
|
98
|
+
const b = anchor(to)
|
|
99
|
+
const x1 = a.right
|
|
100
|
+
const x2 = b.left - 1.5
|
|
101
|
+
// The count sits on the destination's run, past any fan-out bend,
|
|
102
|
+
// where the Traffic view puts it.
|
|
103
|
+
const labelX = ((x1 + x2) / 2 + x2) / 2
|
|
104
|
+
const labelW = 3 + String(count).length * 2.8
|
|
105
|
+
return (
|
|
106
|
+
<g key={`${from}-${to}`}>
|
|
107
|
+
<path d={route(x1, a.y, x2, b.y)} fill="none" stroke="var(--text-tertiary)" strokeOpacity={0.7}
|
|
108
|
+
strokeWidth={0.6 + count / 182} markerEnd={`url(#${arrow})`} />
|
|
109
|
+
<rect x={labelX - labelW / 2} y={b.y - 3.5} width={labelW} height={7} rx={1.5} className="fill-gray-800/90" />
|
|
110
|
+
<text x={labelX} y={b.y + 1.6} textAnchor="middle" fontSize={4.6} className="fill-gray-300">{count}</text>
|
|
111
|
+
</g>
|
|
112
|
+
)
|
|
113
|
+
})}
|
|
114
|
+
|
|
115
|
+
<rect x={INTERNET.x} y={INTERNET.y - NODE_H / 2} width={INTERNET.w} height={NODE_H} rx={4}
|
|
116
|
+
className="fill-sky-500/20 stroke-sky-500/50" strokeWidth={0.6} />
|
|
117
|
+
<text x={INTERNET.x + 5} y={INTERNET.y - 1.5} fontSize={5.6} fontWeight={600} className="fill-sky-700 dark:fill-sky-300">Internet</text>
|
|
118
|
+
<text x={INTERNET.x + 5} y={INTERNET.y + 5} fontSize={4.4} className="fill-sky-700/70 dark:fill-sky-300/70">inbound</text>
|
|
119
|
+
|
|
120
|
+
{Object.entries(NODES).map(([key, n]) => {
|
|
121
|
+
const x = colX(n.col)
|
|
122
|
+
const top = n.y - NODE_H / 2
|
|
123
|
+
return (
|
|
124
|
+
<g key={key}>
|
|
125
|
+
<rect x={x} y={top} width={NODE_W} height={NODE_H} rx={4} fill={NAMESPACES[n.namespace]} />
|
|
126
|
+
<text x={x + 5} y={top + 7.6} fontSize={5.6} fontWeight={600} className="fill-white">{n.name}</text>
|
|
127
|
+
<text x={x + 5} y={top + 13.4} fontSize={4.4} className="fill-white/70">{n.namespace}</text>
|
|
128
|
+
<text x={x + 5} y={top + 20} fontSize={4.4} fontFamily="var(--font-mono, monospace)" className="fill-cyan-300">:{n.port}</text>
|
|
129
|
+
</g>
|
|
130
|
+
)
|
|
131
|
+
})}
|
|
132
|
+
</svg>
|
|
133
|
+
</div>
|
|
88
134
|
)
|
|
89
135
|
}
|
|
90
136
|
|
|
91
137
|
export function TrafficSummary({ data, onNavigate }: TrafficSummaryProps) {
|
|
92
|
-
|
|
93
|
-
|
|
138
|
+
// The server names a source only once Radar has detected one, so no
|
|
139
|
+
// name means "not known yet", never "none installed".
|
|
94
140
|
return (
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
</div>
|
|
105
|
-
{hasFlows && (
|
|
106
|
-
<span className="text-[11px] text-theme-text-tertiary">
|
|
107
|
-
{data.source} · {data.flowCount} flows
|
|
108
|
-
</span>
|
|
109
|
-
)}
|
|
110
|
-
</div>
|
|
111
|
-
|
|
112
|
-
<div className="flex-1 min-h-0 overflow-hidden">
|
|
113
|
-
{hasFlows ? (
|
|
114
|
-
/* Real data: show top flows */
|
|
115
|
-
<div className="px-4 py-2 space-y-1.5">
|
|
116
|
-
{data.topFlows.map((flow, i) => (
|
|
117
|
-
<div key={i} className="flex items-center gap-2 text-xs">
|
|
118
|
-
<span className="text-theme-text-primary truncate">{flow.src}</span>
|
|
119
|
-
<ArrowRightLeft className="w-3 h-3 text-theme-text-tertiary shrink-0" />
|
|
120
|
-
<span className="text-theme-text-primary truncate">{flow.dst}</span>
|
|
121
|
-
<span className="text-xs text-theme-text-tertiary shrink-0 ml-auto">
|
|
122
|
-
{flow.connections} conn
|
|
123
|
-
</span>
|
|
124
|
-
</div>
|
|
125
|
-
))}
|
|
126
|
-
</div>
|
|
127
|
-
) : (
|
|
128
|
-
/* No data yet: schematic + description */
|
|
129
|
-
<div className="flex items-stretch gap-2 px-3 py-1.5 h-full">
|
|
130
|
-
<div className="flex flex-col justify-center gap-1.5 w-[105px] shrink-0">
|
|
131
|
-
<p className="text-[11px] leading-snug text-theme-text-secondary">
|
|
132
|
-
Visualize live service-to-service network flows and external dependencies
|
|
133
|
-
</p>
|
|
134
|
-
{data && (
|
|
135
|
-
<span className="text-[10px] text-theme-text-tertiary">
|
|
136
|
-
Source: {data.source}
|
|
137
|
-
</span>
|
|
138
|
-
)}
|
|
139
|
-
</div>
|
|
140
|
-
<div className="flex-1 min-w-0 overflow-hidden">
|
|
141
|
-
<TrafficSchematic />
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
)}
|
|
145
|
-
</div>
|
|
146
|
-
|
|
147
|
-
<div className="px-4 py-1.5 border-t border-theme-border/50 flex items-center justify-end gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-theme-text-secondary group-hover:text-theme-text-primary transition-colors">
|
|
148
|
-
Open Live Traffic
|
|
149
|
-
<ArrowRight className="w-3.5 h-3.5 transition-transform group-hover:translate-x-0.5" />
|
|
150
|
-
</div>
|
|
151
|
-
</div>
|
|
152
|
-
</button>
|
|
141
|
+
<HomeDiagramCard
|
|
142
|
+
icon={Activity}
|
|
143
|
+
title="Live Traffic"
|
|
144
|
+
fact={data ? trafficSourceName(data.source) : undefined}
|
|
145
|
+
drawing={<TrafficSketch />}
|
|
146
|
+
caption="Which services talk to each other, on which ports, and how much."
|
|
147
|
+
footer="Open Live Traffic"
|
|
148
|
+
onNavigate={onNavigate}
|
|
149
|
+
/>
|
|
153
150
|
)
|
|
154
151
|
}
|
|
@@ -20,6 +20,7 @@ export interface MCPToolParam {
|
|
|
20
20
|
export interface MCPToolInfo {
|
|
21
21
|
name: string
|
|
22
22
|
write?: boolean
|
|
23
|
+
localOnly?: boolean
|
|
23
24
|
desc: string
|
|
24
25
|
params: MCPToolParam[]
|
|
25
26
|
}
|
|
@@ -67,7 +68,7 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
|
|
|
67
68
|
desc: 'Topology graph of relationships between resources — Services, workloads, Pods, Ingresses, owners. Use traffic view for network flow or resources view for ownership hierarchy.',
|
|
68
69
|
params: [
|
|
69
70
|
{ arg: 'namespace', desc: 'filter to a specific namespace' },
|
|
70
|
-
{ arg: 'view', desc: '
|
|
71
|
+
{ arg: 'view', desc: 'resources (default) or traffic' },
|
|
71
72
|
{ arg: 'format', desc: 'graph (default) or summary (text)' },
|
|
72
73
|
],
|
|
73
74
|
},
|
|
@@ -109,17 +110,17 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
|
|
|
109
110
|
},
|
|
110
111
|
{
|
|
111
112
|
name: 'diagnose',
|
|
112
|
-
desc: 'Bounded, point-in-time evidence bundle for one narrowed target — not an agent run and not an authoritative root-cause verdict. For workloads, including Argo Rollout, Radar attempts selected, capped current and previous logs where available, alongside resource context, a capped warning-event sample, and startup blockers; GitOps reconcilers, including Flux HelmRelease, get status summary + parsed related issues; network entry kinds (Service / Ingress / HTTPRoute / GRPCRoute / Gateway) get a coverage-honest path trace that identifies a broken hop only when the evidence establishes one, with an optional one-shot reachability test.',
|
|
113
|
+
desc: 'Bounded, point-in-time evidence bundle for one narrowed target — not an agent run and not an authoritative root-cause verdict. Batch targets return cached context, Issues and events without runtime logs or metrics. For pod-backed workloads, including Argo Rollout, Radar attempts selected, capped current and previous logs where available, alongside resource context, a capped warning-event sample, and startup blockers; GitOps reconcilers, including Flux HelmRelease, get status summary + parsed related issues; network entry kinds (Service / Ingress / HTTPRoute / GRPCRoute / Gateway) get a coverage-honest path trace that identifies a broken hop only when the evidence establishes one, with an optional one-shot reachability test.',
|
|
113
114
|
params: [
|
|
114
|
-
{ arg: 'kind', required: true, desc: 'pod, deployment, statefulset, daemonset, Argo Rollout, application, kustomization, Flux HelmRelease, service, ingress, httproute, grpcroute, or gateway' },
|
|
115
|
+
{ arg: 'kind', required: true, desc: 'pod, deployment, statefulset, daemonset, Argo Rollout, Job, JobSet, RayJob, Kueue Workload, application, kustomization, Flux HelmRelease, service, ingress, httproute, grpcroute, or gateway' },
|
|
115
116
|
{ arg: 'group', desc: 'API group for CRDs or kind collisions (for example argoproj.io for Rollout); built-ins are inferred' },
|
|
116
117
|
{ arg: 'namespace', required: true, desc: 'resource namespace' },
|
|
117
118
|
{ arg: 'name', required: true, desc: 'resource name' },
|
|
118
119
|
{ arg: 'probe', desc: 'network kinds only: add active DNS/TCP/TLS/HTTP probes against the declared path (0-3s wall time)' },
|
|
119
120
|
{ arg: 'in_cluster', desc: 'network kinds: run the probe from inside the cluster via short-lived self-destructing pods (real dataplane) - confirms a route the apiserver proxy could only reach indirectly. Creates up to 5 short-lived probe pods (one per dialed target) under your RBAC' },
|
|
120
|
-
{ arg: 'container', desc: '
|
|
121
|
-
{ arg: 'tail_lines', desc: '
|
|
122
|
-
{ arg: 'since', desc: '
|
|
121
|
+
{ arg: 'container', desc: 'log-collecting targets only: specific container (defaults to all)' },
|
|
122
|
+
{ arg: 'tail_lines', desc: 'log-collecting targets only: lines per pod/stream (default 100)' },
|
|
123
|
+
{ arg: 'since', desc: 'log-collecting targets only: only logs newer than this duration' },
|
|
123
124
|
],
|
|
124
125
|
},
|
|
125
126
|
{
|
|
@@ -172,20 +173,29 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
|
|
|
172
173
|
},
|
|
173
174
|
{
|
|
174
175
|
name: 'list_helm_releases',
|
|
175
|
-
desc: 'All Helm releases with status, resource health, storage namespace, Flux ownership, current lastOperation, and capped operation trails for failed upgrades, rollbacks, or stuck pending operations.',
|
|
176
|
+
desc: 'All Helm releases with status, resource health, storage namespace, Flux ownership, current lastOperation, and capped operation trails for failed upgrades, rollbacks, or stuck pending operations. Without access to Helm’s Secrets, rows come from labels and annotations on objects you can read, with no status.',
|
|
176
177
|
params: [{ arg: 'namespace', desc: 'filter to a specific namespace' }],
|
|
177
178
|
},
|
|
178
179
|
{
|
|
179
180
|
name: 'get_helm_release',
|
|
180
|
-
desc: 'Detailed Helm release info with owned resources, health, Flux ownership, current lastOperation, operationInsight, hooks, and failed/running hook diagnostics with live Job/Pod/Event/redacted-log evidence when available.',
|
|
181
|
+
desc: 'Detailed Helm release info with owned resources, health, Flux ownership, current lastOperation, operationInsight, hooks, and failed/running hook diagnostics with live Job/Pod/Event/redacted-log evidence when available. Without access to Helm’s Secrets, the release as its objects describe it, with no status or history.',
|
|
181
182
|
params: [
|
|
182
183
|
{ arg: 'namespace', required: true, desc: 'Helm storage namespace; use storageNamespace from list_helm_releases when present' },
|
|
183
184
|
{ arg: 'name', required: true, desc: 'release name' },
|
|
184
|
-
{ arg: 'include', desc: 'values, history, operations, diff, values_diff, notes_diff, resource_diff' },
|
|
185
|
+
{ arg: 'include', desc: 'chart (stored defaults/schema), notes (untrusted), versions (upgrade targets from the confirmed source), values, history, operations, diff, values_diff, notes_diff, resource_diff' },
|
|
186
|
+
{ arg: 'chart_path', desc: 'with include=chart: JSON pointer into defaults; omit to list top-level paths' },
|
|
185
187
|
{ arg: 'diff_revision_1', desc: 'first revision for any diff include' },
|
|
186
188
|
{ arg: 'diff_revision_2', desc: 'second revision for any diff include (defaults to current)' },
|
|
187
189
|
],
|
|
188
190
|
},
|
|
191
|
+
{
|
|
192
|
+
name: 'get_helm_chart',
|
|
193
|
+
desc: 'Versions of a chart in a configured repository or OCI source, newest first, read live before installing it; latest is the newest non-prerelease.',
|
|
194
|
+
params: [
|
|
195
|
+
{ arg: 'repository', required: true, desc: 'configured repository name or URL, or OCI prefix: the value an install uses' },
|
|
196
|
+
{ arg: 'chart', required: true, desc: 'chart name' },
|
|
197
|
+
],
|
|
198
|
+
},
|
|
189
199
|
{
|
|
190
200
|
name: 'list_packages',
|
|
191
201
|
desc: 'Unified "what\'s installed" view across Helm releases, workload labels, CRD registrations, and GitOps declarations (Argo + Flux), with sources, versions, health, and a sourceLegend for the stable source codes.',
|
|
@@ -208,7 +218,7 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
|
|
|
208
218
|
},
|
|
209
219
|
{
|
|
210
220
|
name: 'search',
|
|
211
|
-
desc: 'Find resources by content/term match — config keys, env refs, images, label values, ConfigMap data, CRD fields, status messages. Secret values are never indexed.',
|
|
221
|
+
desc: 'Find resources by content/term match — config keys, env refs, images, label values, ConfigMap data, CRD fields, status messages, or an IP/ip:port to find the Pod, Service or Node holding it. Secret values are never indexed.',
|
|
212
222
|
params: [
|
|
213
223
|
{ arg: 'query', required: true, desc: 'tokens AND\'d; modifiers kind:, ns:, label:, image:' },
|
|
214
224
|
{ arg: 'limit', desc: 'max hits (default 50, max 500)' },
|
|
@@ -297,7 +307,7 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
|
|
|
297
307
|
name: 'get_workload_logs',
|
|
298
308
|
desc: 'Aggregated logs across all pods of a workload. Without grep, filters for diagnostic relevance; grep returns only matching timestamp-prefixed lines instead.',
|
|
299
309
|
params: [
|
|
300
|
-
{ arg: 'kind', desc: 'deployment (default), statefulset, daemonset, job, or workflow' },
|
|
310
|
+
{ arg: 'kind', desc: 'deployment (default), statefulset, daemonset, rollout, job, or workflow' },
|
|
301
311
|
{ arg: 'namespace', required: true, desc: 'workload namespace' },
|
|
302
312
|
{ arg: 'name', required: true, desc: 'workload name' },
|
|
303
313
|
{ arg: 'container', desc: 'specific container (defaults to all)' },
|
|
@@ -307,6 +317,18 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
|
|
|
307
317
|
{ arg: 'previous', desc: 'logs from the previous terminated container' },
|
|
308
318
|
],
|
|
309
319
|
},
|
|
320
|
+
{
|
|
321
|
+
name: 'curl_service',
|
|
322
|
+
write: true,
|
|
323
|
+
desc: 'HTTP GET to a selector-backed Service with a ClusterIP from in-cluster Radar, with status/body and no Kubernetes credentials. Requires --mcp-http-tools and get services/proxy permission. No redirects or authenticated requests; internal TLS certificates are not verified.',
|
|
324
|
+
params: [
|
|
325
|
+
{ arg: 'namespace', required: true, desc: 'Service namespace' },
|
|
326
|
+
{ arg: 'name', required: true, desc: 'Service name' },
|
|
327
|
+
{ arg: 'port', required: true, desc: 'numeric Service port' },
|
|
328
|
+
{ arg: 'scheme', desc: 'http (default) or https' },
|
|
329
|
+
{ arg: 'path', desc: 'path and query; defaults to /' },
|
|
330
|
+
],
|
|
331
|
+
},
|
|
310
332
|
{
|
|
311
333
|
name: 'exec_pod',
|
|
312
334
|
write: true,
|
|
@@ -320,10 +342,41 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
|
|
|
320
342
|
{ arg: 'timeout_seconds', desc: 'one deadline for resolution and execution; default 30, max 45 seconds; 64 KiB per output stream' },
|
|
321
343
|
],
|
|
322
344
|
},
|
|
345
|
+
{
|
|
346
|
+
name: 'collect_application_evidence',
|
|
347
|
+
localOnly: true,
|
|
348
|
+
desc: 'Read one Pod’s RabbitMQ alarms/resource values, NATS JetStream observations or Vault node state. Local only, with operator approval and Pod-read/port-forward permissions. Unavailable evidence is not a health verdict.',
|
|
349
|
+
params: [
|
|
350
|
+
{ arg: 'application', required: true, desc: 'rabbitmq, nats, or vault' },
|
|
351
|
+
{ arg: 'namespace', required: true, desc: 'Pod namespace' },
|
|
352
|
+
{ arg: 'pod', required: true, desc: 'one explicitly selected Pod' },
|
|
353
|
+
{ arg: 'pod_uid', desc: 'expected Pod UID from a diagnosis suggestion' },
|
|
354
|
+
{ arg: 'confirm_network_access', required: true, desc: 'true after operator authorization to collect endpoint evidence' },
|
|
355
|
+
],
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
name: 'manage_helm',
|
|
359
|
+
write: true,
|
|
360
|
+
desc: 'Install, upgrade, roll back or uninstall a native Helm release. Uses your Kubernetes permissions. Keep GitOps-managed dependencies in git. Upgrade and rollback can be previewed first; a rollback preview names objects it would take over from other releases. Uninstall previews what it deletes, keeps and runs before accepting a reviewed confirmation token.',
|
|
361
|
+
params: [
|
|
362
|
+
{ arg: 'action', required: true, desc: 'install, upgrade, rollback, or uninstall' },
|
|
363
|
+
{ arg: 'namespace', required: true, desc: 'release storage namespace' },
|
|
364
|
+
{ arg: 'name', required: true, desc: 'release name' },
|
|
365
|
+
{ arg: 'chart', desc: 'chart name for install' },
|
|
366
|
+
{ arg: 'repository', desc: 'configured install source; upgrade optionally asserts the confirmed saved source and requires it to be configured' },
|
|
367
|
+
{ arg: 'version', desc: 'exact version for install (choices from get_helm_chart); upgrade choices come from get_helm_release include=versions; omit on upgrade only when latest and deployed charts agree' },
|
|
368
|
+
{ arg: 'values', desc: 'upgrade overrides merge over the deployed revision\'s overrides; no literal credentials' },
|
|
369
|
+
{ arg: 'replace_values', desc: 'upgrade only: explicitly replace all stored overrides with values' },
|
|
370
|
+
{ arg: 'dry_run', desc: 'upgrade or rollback: advisory preview (upgrade: same merge rules; rollback: stored diff plus live takeover and retention checks); false executes' },
|
|
371
|
+
{ arg: 'expected_revision', desc: 'upgrade or rollback: refuse a changed latest revision; not an atomic lock' },
|
|
372
|
+
{ arg: 'revision', desc: 'positive rollback revision from release history' },
|
|
373
|
+
{ arg: 'confirm', desc: 'reviewed preview token to execute uninstall; expires after 5 minutes' },
|
|
374
|
+
],
|
|
375
|
+
},
|
|
323
376
|
{
|
|
324
377
|
name: 'manage_workload',
|
|
325
378
|
write: true,
|
|
326
|
-
desc: 'Operate on a workload: restart triggers a rolling restart, scale changes the replica count, rollback reverts to a previous revision. Rollout rollback re-runs every canary step — pair it with manage_rollout promote-full, or abort instead.',
|
|
379
|
+
desc: 'Operate on a workload: restart triggers a rolling restart, scale changes the replica count, rollback reverts to a previous revision. Roll back a native Helm release\'s workload as the Helm release, not the workload alone. Rollout rollback re-runs every canary step — pair it with manage_rollout promote-full, or abort instead.',
|
|
327
380
|
params: [
|
|
328
381
|
{ arg: 'action', required: true, desc: 'restart, scale, or rollback' },
|
|
329
382
|
{ arg: 'kind', required: true, desc: 'deployment, statefulset, daemonset, or rollout' },
|
|
@@ -356,13 +409,13 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
|
|
|
356
409
|
{
|
|
357
410
|
name: 'manage_gitops',
|
|
358
411
|
write: true,
|
|
359
|
-
desc: 'Operate on GitOps resources.
|
|
412
|
+
desc: 'Operate on GitOps resources. Argo CD: sync, refresh, terminate, rollback, suspend, resume. Flux: reconcile, sync-with-source, suspend, resume.',
|
|
360
413
|
params: [
|
|
361
414
|
{ arg: 'action', required: true, desc: 'sync/reconcile, refresh, terminate, rollback, suspend, or resume' },
|
|
362
415
|
{ arg: 'tool', required: true, desc: 'argocd or fluxcd' },
|
|
363
416
|
{ arg: 'namespace', required: true, desc: 'resource namespace' },
|
|
364
417
|
{ arg: 'name', required: true, desc: 'resource name' },
|
|
365
|
-
{ arg: 'kind', desc: '
|
|
418
|
+
{ arg: 'kind', desc: 'Flux resource kind (e.g. kustomization, helmrelease)' },
|
|
366
419
|
],
|
|
367
420
|
},
|
|
368
421
|
{
|
|
@@ -191,6 +191,17 @@ describe('issueSubjectState', () => {
|
|
|
191
191
|
it('reads an empty answer as unconfirmed when RBAC withheld issues about it', () => {
|
|
192
192
|
expect(issueSubjectState(subject, [], loaded({ withheld: { issues: 2 } }))).toEqual({ state: 'unconfirmed', why: 'your permissions withhold 2 issues about it' })
|
|
193
193
|
})
|
|
194
|
+
it('reads an empty answer as unconfirmed when a check about it could not be made for the caller', () => {
|
|
195
|
+
const unchecked = [{ source: 'kueue', reason: 'caller_access_denied', kinds: [{ group: 'kueue.x-k8s.io', kind: 'ClusterQueue' }] }]
|
|
196
|
+
expect(issueSubjectState(subject, [], loaded({ unchecked_sources: unchecked }))).toEqual({ state: 'unconfirmed', why: "you can't read ClusterQueues, which this check needs" })
|
|
197
|
+
})
|
|
198
|
+
it('keeps unchecked evidence alongside findings and withheld issue counts', () => {
|
|
199
|
+
const found = issue({ kind: 'Job', namespace: 'pg', name: 'main' })
|
|
200
|
+
const unchecked = [{ source: 'kueue', reason: 'caller_access_denied', kinds: [{ group: 'kueue.x-k8s.io', kind: 'ClusterQueue' }] }]
|
|
201
|
+
expect(issueSubjectState(subject, [], loaded({ issues: [found], withheld: { issues: 1 }, unchecked_sources: unchecked }))).toEqual({
|
|
202
|
+
state: 'found', issues: [found], withheld: 1, uncheckedWhy: "you can't read ClusterQueues, which this check needs",
|
|
203
|
+
})
|
|
204
|
+
})
|
|
194
205
|
it('reads an empty answer under limited visibility as unconfirmed, never none', () => {
|
|
195
206
|
expect(issueSubjectState(subject, [], loaded({ visibility: { state: 'degraded', impact: 'Pods are not readable.' } }))).toEqual({ state: 'unconfirmed', why: "some evidence isn't readable (Pods are not readable)" })
|
|
196
207
|
expect(issueSubjectState(subject, [], loaded({ visibility: { state: 'limited' } }))).toEqual({ state: 'unconfirmed', why: "some evidence isn't readable" })
|
|
@@ -25,7 +25,8 @@ import {
|
|
|
25
25
|
import { builtinGroupForKind } from "@skyhook-io/k8s-ui/utils/api-resources";
|
|
26
26
|
import { AlertTriangle } from "lucide-react";
|
|
27
27
|
import { IssueDiagnoseButton } from "../diagnose/LocalDiagnoseAction";
|
|
28
|
-
import {
|
|
28
|
+
import { recordUsageEvent } from "../../api/usage-data";
|
|
29
|
+
import { uncheckedSourceLines, uncheckedSubjectWhy } from "./uncheckedSources";
|
|
29
30
|
import { UncheckedSourceHelp } from "./UncheckedSourceHelp";
|
|
30
31
|
|
|
31
32
|
// A capacity-relevant issue links to its Karpenter diagnosis. Karpenter is
|
|
@@ -114,7 +115,7 @@ export type IssueSubjectState =
|
|
|
114
115
|
| { state: "hidden" }
|
|
115
116
|
| { state: "checking" }
|
|
116
117
|
| { state: "unconfirmed"; why: string }
|
|
117
|
-
| { state: "found"; issues: Issue[]; withheld: number }
|
|
118
|
+
| { state: "found"; issues: Issue[]; withheld: number; uncheckedWhy?: string }
|
|
118
119
|
| { state: "none" };
|
|
119
120
|
|
|
120
121
|
/**
|
|
@@ -137,7 +138,8 @@ export function issueSubjectState(
|
|
|
137
138
|
}
|
|
138
139
|
const data = related.data;
|
|
139
140
|
if (related.isLoading || !data) return { state: "checking" };
|
|
140
|
-
|
|
141
|
+
const uncheckedWhy = uncheckedSubjectWhy(data.unchecked_sources);
|
|
142
|
+
if (data.issues.length > 0) return { state: "found", issues: data.issues, withheld: data.withheld?.issues ?? 0, ...(uncheckedWhy ? { uncheckedWhy } : {}) };
|
|
141
143
|
if (data.coverage === "unknownKind") return { state: "unconfirmed", why: "this cluster has no such kind" };
|
|
142
144
|
if (data.coverage === "notWatched") return { state: "unconfirmed", why: `Radar isn't watching ${subject.kind}` };
|
|
143
145
|
if (data.coverage === "syncing") return { state: "unconfirmed", why: `Radar is still loading ${subject.kind}` };
|
|
@@ -145,6 +147,7 @@ export function issueSubjectState(
|
|
|
145
147
|
if (withheld > 0) {
|
|
146
148
|
return { state: "unconfirmed", why: `your permissions withhold ${withheld} ${withheld === 1 ? "issue" : "issues"} about it` };
|
|
147
149
|
}
|
|
150
|
+
if (uncheckedWhy) return { state: "unconfirmed", why: uncheckedWhy };
|
|
148
151
|
const visibility = data.visibility;
|
|
149
152
|
if (visibility?.state === "degraded" || visibility?.state === "limited") {
|
|
150
153
|
return {
|
|
@@ -235,13 +238,15 @@ export function IssuesPane({
|
|
|
235
238
|
return next;
|
|
236
239
|
});
|
|
237
240
|
|
|
238
|
-
const onResourceClick = (ref: IssueResourceRef) =>
|
|
241
|
+
const onResourceClick = (ref: IssueResourceRef) => {
|
|
242
|
+
recordUsageEvent({ type: "ui", name: "issue_action:open" });
|
|
239
243
|
onNavigateToResource({
|
|
240
244
|
kind: ref.kind,
|
|
241
245
|
namespace: ref.namespace ?? "",
|
|
242
246
|
name: ref.name,
|
|
243
247
|
group: ref.group ?? "",
|
|
244
248
|
});
|
|
249
|
+
};
|
|
245
250
|
|
|
246
251
|
if (!subject && isLoading) {
|
|
247
252
|
return <PaneLoader label="Loading issues…" className="flex-1" />;
|
|
@@ -373,6 +378,8 @@ export function IssuesPane({
|
|
|
373
378
|
{subjectState.state === "unconfirmed" && ` — can't confirm: ${subjectState.why}`}
|
|
374
379
|
{subjectState.state === "found" && subjectState.withheld > 0 &&
|
|
375
380
|
` — your permissions withhold ${subjectState.withheld} more`}
|
|
381
|
+
{subjectState.state === "found" && subjectState.uncheckedWhy &&
|
|
382
|
+
` — some checks are unconfirmed: ${subjectState.uncheckedWhy}`}
|
|
376
383
|
</span>
|
|
377
384
|
)}
|
|
378
385
|
<button type="button" onClick={clearSubject} className="text-accent-text hover:underline">
|
|
@@ -424,7 +431,10 @@ export function IssuesPane({
|
|
|
424
431
|
{capacityHref && (
|
|
425
432
|
<button
|
|
426
433
|
type="button"
|
|
427
|
-
onClick={() =>
|
|
434
|
+
onClick={() => {
|
|
435
|
+
recordUsageEvent({ type: "ui", name: "issue_action:capacity" });
|
|
436
|
+
navigate(capacityHref);
|
|
437
|
+
}}
|
|
428
438
|
className="rounded-md border border-theme-border px-2 py-1 text-xs font-medium text-accent-text transition-colors hover:bg-theme-hover"
|
|
429
439
|
>
|
|
430
440
|
View in Capacity →
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import { UNKNOWN_SOURCE_LINE, uncheckedSourceLines } from './uncheckedSources'
|
|
2
|
+
import { UNKNOWN_SOURCE_LINE, uncheckedSourceLines, uncheckedSubjectWhy } from './uncheckedSources'
|
|
3
3
|
|
|
4
4
|
describe('uncheckedSourceLines', () => {
|
|
5
5
|
it('names the kinds still loading', () => {
|
|
@@ -28,10 +28,31 @@ describe('uncheckedSourceLines', () => {
|
|
|
28
28
|
})
|
|
29
29
|
|
|
30
30
|
it("says when Radar's own service account is the problem", () => {
|
|
31
|
+
expect(uncheckedSourceLines([{ source: 'helm', reason: 'caller_access_denied' }]))
|
|
32
|
+
.toEqual(['Radar can\'t read Helm\'s release Secrets here, so failed or stuck releases may be missing.'])
|
|
31
33
|
expect(uncheckedSourceLines([{ source: 'helm', reason: 'collector_access_denied' }]))
|
|
32
34
|
.toEqual(["Helm releases couldn't be checked because Radar's service account isn't allowed to impersonate users, so failed or stuck releases may be missing."])
|
|
33
35
|
})
|
|
34
36
|
|
|
37
|
+
it('says a Kueue queue check was skipped because the caller cannot read ClusterQueues', () => {
|
|
38
|
+
expect(uncheckedSourceLines([{
|
|
39
|
+
source: 'kueue', reason: 'caller_access_denied', kinds: [{ group: 'kueue.x-k8s.io', kind: 'ClusterQueue' }],
|
|
40
|
+
}])).toEqual(["You can't read ClusterQueues, so Radar can't tell you whether a queue your runs wait on is stopped on purpose or broken."])
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it('explains a per-resource gap with or without kinds', () => {
|
|
44
|
+
expect(uncheckedSubjectWhy([{ source: 'kueue', reason: 'caller_access_denied' }])).toBe("you can't read what this check needs")
|
|
45
|
+
expect(uncheckedSubjectWhy([{ source: 'kueue', reason: 'read_failed' }])).toBe("some checks couldn't run")
|
|
46
|
+
expect(uncheckedSubjectWhy(undefined)).toBeUndefined()
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
it('names Kueue kinds Radar could not load', () => {
|
|
50
|
+
expect(uncheckedSourceLines([{ source: 'kueue', reason: 'kind_sync_pending', kinds: [{ group: 'kueue.x-k8s.io', kind: 'LocalQueue' }] }]))
|
|
51
|
+
.toEqual(['Still loading LocalQueues, so their issues may be missing.'])
|
|
52
|
+
expect(uncheckedSourceLines([{ source: 'kueue', reason: 'read_failed' }]))
|
|
53
|
+
.toEqual(["Kueue resources couldn't be checked, so blocked runs and broken queues may be missing."])
|
|
54
|
+
})
|
|
55
|
+
|
|
35
56
|
it('falls back to the source line for a reason this version does not know', () => {
|
|
36
57
|
expect(uncheckedSourceLines([{ source: 'karpenter', reason: 'something_new' }]))
|
|
37
58
|
.toEqual(["Karpenter resources couldn't be checked, so NodePool and NodeClaim issues may be missing."])
|