@skyhook-io/radar-app 1.21.8 → 1.22.0

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.
Files changed (32) hide show
  1. package/package.json +1 -1
  2. package/src/App.tsx +14 -0
  3. package/src/api/client.ts +6 -0
  4. package/src/api/radarFeatures.ts +4 -0
  5. package/src/api/traefik.ts +33 -0
  6. package/src/api/traffic.ts +1 -0
  7. package/src/components/CloudFunnelButton.test.tsx +39 -1
  8. package/src/components/CloudFunnelButton.tsx +10 -3
  9. package/src/components/cnpg/CNPGOverview.test.tsx +75 -3
  10. package/src/components/cnpg/CNPGOverview.tsx +62 -4
  11. package/src/components/home/NetworkPolicyCoverageCard.test.tsx +37 -0
  12. package/src/components/home/NetworkPolicyCoverageCard.tsx +26 -2
  13. package/src/components/resources/renderers/TraefikIngressRouteRenderer.test.tsx +23 -0
  14. package/src/components/resources/renderers/TraefikIngressRouteRenderer.tsx +23 -0
  15. package/src/components/resources/renderers/TraefikMiddlewareRenderer.test.tsx +23 -0
  16. package/src/components/resources/renderers/TraefikMiddlewareRenderer.tsx +29 -0
  17. package/src/components/traffic/TrafficConnectionsTable.test.tsx +23 -0
  18. package/src/components/traffic/TrafficConnectionsTable.tsx +5 -4
  19. package/src/components/traffic/TrafficFilterSidebar.test.tsx +14 -0
  20. package/src/components/traffic/TrafficFilterSidebar.tsx +17 -0
  21. package/src/components/traffic/TrafficFlowList.tsx +5 -5
  22. package/src/components/traffic/TrafficGraph.test.tsx +11 -0
  23. package/src/components/traffic/TrafficGraph.tsx +31 -19
  24. package/src/components/traffic/TrafficView.tsx +17 -6
  25. package/src/components/traffic/traffic-export.test.ts +8 -0
  26. package/src/components/traffic/traffic-export.ts +7 -4
  27. package/src/components/traffic/trafficFilters.test.ts +51 -1
  28. package/src/components/traffic/trafficFilters.ts +39 -11
  29. package/src/components/ui/command-items-crd.test.tsx +23 -8
  30. package/src/components/whats-new/releaseNotes.ts +75 -1
  31. package/src/integrations/resourceHosts.test.tsx +1 -1
  32. package/src/integrations/resourceHosts.tsx +3 -0
@@ -1,5 +1,5 @@
1
1
  import { formatBytes } from '@skyhook-io/k8s-ui/utils/format'
2
- import type { AggregatedFlow, TrafficFlow, TrafficWarningKind } from '../../types'
2
+ import type { AggregatedFlow, TrafficFlow, TrafficPortSource, TrafficWarningKind } from '../../types'
3
3
  import type { TrafficEndpointPair, TrafficEndpointRef, TrafficMatch } from '../../api/traffic'
4
4
  import type { TrafficGraphSelection } from './TrafficGraph'
5
5
 
@@ -415,6 +415,33 @@ export function mergedEdgePort(a: number, b: number): number {
415
415
  return Math.min(a, b)
416
416
  }
417
417
 
418
+ /**
419
+ * The port as text, or null when there is none to show. A port taken from the
420
+ * destination's Services is declared, not observed, so it always says so.
421
+ */
422
+ export function portLabel(port: number, portSource?: TrafficPortSource): string | null {
423
+ if (portSource === 'serviceMultiple') return 'multiple (from Service)'
424
+ if (port <= 0) return null
425
+ return portSource === 'service' ? `${port} (from Service)` : String(port)
426
+ }
427
+
428
+ /** mergedEdgePort, keeping the shown port's marking with it. An observed port
429
+ * outranks the same number taken from a Service. */
430
+ export function mergeEdgePortInto(
431
+ into: { port: number; portSource?: TrafficPortSource },
432
+ from: { port: number; portSource?: TrafficPortSource },
433
+ ): void {
434
+ const port = mergedEdgePort(into.port, from.port)
435
+ if (port === 0) {
436
+ if (from.portSource) into.portSource = from.portSource
437
+ } else if (port !== into.port) {
438
+ into.portSource = from.portSource
439
+ } else if (port === from.port && !from.portSource) {
440
+ into.portSource = undefined
441
+ }
442
+ into.port = port
443
+ }
444
+
418
445
  /**
419
446
  * Whether an edge carries a port: its own, or one of the edges merged into it.
420
447
  * A merged edge shows one of its ports, so a selection made on another must
@@ -452,6 +479,7 @@ export function endpointPair(flow: AggregatedFlow): TrafficEndpointPair {
452
479
  destination: ref(flow.destination),
453
480
  port: flow.port,
454
481
  ...(flow.directionUnknown && { directionUnknown: true }),
482
+ ...(flow.likelyOverlay && { likelyOverlay: true }),
455
483
  }
456
484
  }
457
485
 
@@ -475,11 +503,11 @@ export function groupAddonFlows(flows: GraphFlow[], isAddon: (name: string, name
475
503
  connections: 0, bytesSent: 0, bytesRecv: 0, flowCount: 0, lastSeen: flow.lastSeen,
476
504
  source: { name: 'addon-internet', namespace: '', kind: 'AddonInternet' },
477
505
  destination: { name: 'addon-group-target', namespace: '', kind: 'AddonGroupTarget' },
478
- protocol: flow.protocol, port: flow.port, l7Protocol: flow.l7Protocol,
506
+ protocol: flow.protocol, port: flow.port, portSource: flow.portSource, l7Protocol: flow.l7Protocol,
479
507
  rawPairs: [],
480
508
  }
481
509
  }
482
- internet.port = mergedEdgePort(internet.port, flow.port)
510
+ mergeEdgePortInto(internet, flow)
483
511
  if (internet.protocol !== flow.protocol) internet.protocol = 'mixed'
484
512
  if (internet.l7Protocol !== flow.l7Protocol) internet.l7Protocol = 'mixed'
485
513
  mergeFlowVolume(internet, flow)
@@ -492,11 +520,11 @@ export function groupAddonFlows(flows: GraphFlow[], isAddon: (name: string, name
492
520
  connections: 0, bytesSent: 0, bytesRecv: 0, flowCount: 0, lastSeen: flow.lastSeen,
493
521
  source: { name: 'addon-group-source', namespace: '', kind: 'AddonGroupSource' },
494
522
  destination: { name: 'kubernetes', namespace: 'default', kind: 'Service' },
495
- protocol: flow.protocol, port: flow.port, l7Protocol: flow.l7Protocol,
523
+ protocol: flow.protocol, port: flow.port, portSource: flow.portSource, l7Protocol: flow.l7Protocol,
496
524
  rawPairs: [],
497
525
  }
498
526
  }
499
- kubernetes.port = mergedEdgePort(kubernetes.port, flow.port)
527
+ mergeEdgePortInto(kubernetes, flow)
500
528
  if (kubernetes.protocol !== flow.protocol) kubernetes.protocol = 'mixed'
501
529
  if (kubernetes.l7Protocol !== flow.l7Protocol) kubernetes.l7Protocol = 'mixed'
502
530
  mergeFlowVolume(kubernetes, flow)
@@ -532,8 +560,8 @@ export function graphEndpointId(e: { namespace?: string; name: string }): string
532
560
  return e.namespace ? `${e.namespace}/${e.name}` : e.name
533
561
  }
534
562
 
535
- export function pairKey(source: { namespace?: string; name: string }, destination: { namespace?: string; name: string }, port: number, directionUnknown?: boolean): string {
536
- return `${graphEndpointId(source)}->${graphEndpointId(destination)}:${port}${directionUnknown ? ':u' : ''}`
563
+ export function pairKey(source: { namespace?: string; name: string }, destination: { namespace?: string; name: string }, port: number, directionUnknown?: boolean, likelyOverlay?: boolean): string {
564
+ return `${graphEndpointId(source)}->${graphEndpointId(destination)}:${port}${directionUnknown ? ':u' : ''}${likelyOverlay ? ':v' : ''}`
537
565
  }
538
566
 
539
567
  /**
@@ -550,12 +578,12 @@ export function selectedEdgeMatcher(
550
578
  drawn: (e: TrafficFlow['source']) => { namespace?: string; name: string },
551
579
  ): (f: TrafficFlow) => boolean {
552
580
  if (!pairs) return () => true
553
- const keys = new Set(pairs.map(p => pairKey(p.source, p.destination, p.port, p.directionUnknown)))
581
+ const keys = new Set(pairs.map(p => pairKey(p.source, p.destination, p.port, p.directionUnknown, p.likelyOverlay)))
554
582
  const callers = responsesCallerOriented ? null : new Set(pairs.map(p => `${graphEndpointId(p.source)}->${graphEndpointId(p.destination)}`))
555
583
  return f => {
556
584
  const src = drawn(f.source)
557
585
  const dst = drawn(f.destination)
558
- if (keys.has(pairKey(src, dst, f.port, f.directionUnknown))) return true
586
+ if (keys.has(pairKey(src, dst, f.port, f.directionUnknown, f.likelyOverlay))) return true
559
587
  // The response travels callee to caller: reversed, it is the edge's.
560
588
  return !!callers && f.l7Protocol === 'HTTP' && f.l7Type === 'RESPONSE' &&
561
589
  callers.has(`${graphEndpointId(dst)}->${graphEndpointId(src)}`)
@@ -584,14 +612,14 @@ export function selectionRawPairs(
584
612
  return selection.type === 'node'
585
613
  ? sourceId === selection.nodeId || destId === selection.nodeId
586
614
  : sourceId === selection.sourceId && destId === selection.destId &&
587
- !!flow.directionUnknown === !!selection.directionUnknown
615
+ !!flow.directionUnknown === !!selection.directionUnknown && !!flow.likelyOverlay === !!selection.likelyOverlay
588
616
  })
589
617
  // An edge stands for its port; an edge merged from several ports shows one
590
618
  // of them and carries the rest (edgesOnPort).
591
619
  const selected = selection.type === 'node' ? touching : edgesOnPort(touching, f => f, selection.port)
592
620
  for (const flow of selected) {
593
621
  for (const pair of flow.rawPairs ?? []) {
594
- pairs.set(pairKey(pair.source, pair.destination, pair.port, pair.directionUnknown), pair)
622
+ pairs.set(pairKey(pair.source, pair.destination, pair.port, pair.directionUnknown, pair.likelyOverlay), pair)
595
623
  }
596
624
  }
597
625
  if (pairs.size === 0) return null
@@ -4,20 +4,35 @@ import { createRoot } from 'react-dom/client'
4
4
  import { expect, it, vi } from 'vitest'
5
5
  import { bestScore, useCommandItems } from './command-items'
6
6
  vi.mock('../../api/client', () => ({ useNamespaces: () => ({ data: [] }), useContexts: () => ({ data: [] }) }))
7
- vi.mock('../../api/apiResources', () => ({ CORE_RESOURCES: [], useAPIResources: () => ({ data: [{ group: 'apiextensions.k8s.io', kind: 'CustomResourceDefinition', name: 'customresourcedefinitions', verbs: ['list'] }, { group: '', kind: 'Pod', name: 'pods', verbs: ['list'] }] }) }))
7
+ vi.mock('../../api/apiResources', () => ({
8
+ CORE_RESOURCES: [],
9
+ useAPIResources: () => ({
10
+ data: [
11
+ { group: 'apiextensions.k8s.io', kind: 'CustomResourceDefinition', name: 'customresourcedefinitions', verbs: ['list'] },
12
+ { group: '', kind: 'Pod', name: 'pods', verbs: ['list'] },
13
+ { group: 'policy', kind: 'PodDisruptionBudget', name: 'poddisruptionbudgets', verbs: ['list'], shortNames: ['pdb'] },
14
+ ],
15
+ }),
16
+ }))
8
17
  ;(globalThis as any).IS_REACT_ACT_ENVIRONMENT = true
9
- it('uses the shared CRD aliases in command items', () => {
10
- let scores: number[] = []
18
+ it('uses the shared CRD aliases and discovered short names in command items', () => {
19
+ let crdScores: number[] = []
20
+ let pdbScores: number[] = []
11
21
  function Probe() {
12
22
  const cb = { onNavigateView: vi.fn(), onNavigateKind: vi.fn(), onSwitchContext: vi.fn(), onSetNamespaces: vi.fn(), onToggleTheme: vi.fn() }
13
- const items = useCommandItems(cb)
14
- scores = items.filter(i => i.category === 'Resource Kinds').map(i => bestScore(i, 'crd'))
23
+ const items = useCommandItems(cb).filter(i => i.category === 'Resource Kinds')
24
+ crdScores = items.map(i => bestScore(i, 'crd'))
25
+ pdbScores = items.map(i => bestScore(i, 'pdb'))
15
26
  return null
16
27
  }
17
28
  const host = document.createElement('div'); const root = createRoot(host)
18
29
  act(() => root.render(<Probe />))
19
- expect(scores).toHaveLength(2)
20
- expect(scores[0]).toBeGreaterThan(0)
21
- expect(scores[1]).toBe(0)
30
+ expect(crdScores).toHaveLength(3)
31
+ expect(crdScores[0]).toBeGreaterThan(0)
32
+ expect(crdScores[1]).toBe(0)
33
+ expect(crdScores[2]).toBe(0)
34
+ expect(pdbScores[0]).toBe(0)
35
+ expect(pdbScores[1]).toBe(0)
36
+ expect(pdbScores[2]).toBeGreaterThanOrEqual(100)
22
37
  act(() => root.unmount())
23
38
  })
@@ -1,5 +1,5 @@
1
1
  import type { LucideIcon } from 'lucide-react'
2
- import { Activity, BellOff, Bot, Boxes, Braces, Database, GitBranch, GitCompareArrows, HardDrive, Hourglass, Layers, MessageCircleQuestionMark, Network, RefreshCcw, Scale, ScanSearch, ScrollText, Search, ShieldAlert, SlidersHorizontal, Undo2, Zap } from 'lucide-react'
2
+ import { Activity, BellOff, Bot, Boxes, Braces, Bug, ChartLine, Database, Download, GitBranch, GitCompareArrows, HardDrive, History, Hourglass, Layers, MessageCircleQuestionMark, Network, RefreshCcw, Scale, ScanSearch, ScrollText, Search, ShieldAlert, SlidersHorizontal, Undo2, Zap } from 'lucide-react'
3
3
  import { compareVersions } from '../../utils/version'
4
4
 
5
5
  export interface ReleaseHighlight {
@@ -48,6 +48,80 @@ export const CHANGELOG_URL = 'https://radarhq.io/changelog'
48
48
  // major release must have its own entry: scripts/check-whats-new.sh refuses to
49
49
  // release one without it.
50
50
  export const RELEASE_NOTES: ReleaseNotes[] = [
51
+ {
52
+ version: 'v1.22.0',
53
+ highlights: [
54
+ {
55
+ id: 'app-deploys-timeline',
56
+ icon: History,
57
+ title: 'Detailed deployment and rollout history for applications and workloads',
58
+ description: 'Applications get a Deploys tab (Helm, Flux and Argo CD, with Argo sync diffs) and a richer Timeline; workloads get a Revisions tab to diff specs.',
59
+ leadDescription: "The Timeline tab in Applications now puts deploys, config changes and problems in one view. A new Deploys tab tracks Helm releases, Flux history and Argo CD syncs (with inline rendered diffs when the Argo CD API is connected), and a new Revisions tab on workloads lets you diff pod templates even when the image tag didn't change.",
60
+ importance: 7,
61
+ path: '/applications',
62
+ cta: 'Open Applications',
63
+ },
64
+ {
65
+ id: 'new-integration-views',
66
+ icon: Boxes,
67
+ title: 'New integrations: MetalLB, Longhorn and k3s',
68
+ description: 'MetalLB pools, peers and config Issues; Longhorn Volumes with live replicas, PV links and Issues; and k3s/RKE2 HelmChart badges and drawers.',
69
+ importance: 7,
70
+ },
71
+ {
72
+ id: 'issues-recent-changes',
73
+ icon: GitCompareArrows,
74
+ title: 'See what changed before an issue started',
75
+ description: 'Issue rows and expanded details show recent changes before failure, and related issues group into one panel per application.',
76
+ importance: 7,
77
+ path: '/issues',
78
+ cta: 'Open Issues',
79
+ },
80
+ {
81
+ id: 'vulnerabilities-exposure-csv',
82
+ icon: ShieldAlert,
83
+ title: 'Prioritize exposed CVEs and export CSV',
84
+ description: 'Sort CVEs by severity then external exposure, filter exposed workloads in UI or MCP, export full CSVs, and scan private Amazon ECR for Java4Shell.',
85
+ importance: 7,
86
+ path: '/checks/vulnerabilities',
87
+ cta: 'Open Vulnerabilities',
88
+ },
89
+ {
90
+ id: 'export-graphs',
91
+ icon: Download,
92
+ title: 'Export graphs to SVG and draw.io',
93
+ description: 'Export Topology and Live Traffic as editable draw.io diagrams with K8s icons and namespace containers, vector SVG, or theme-matched images.',
94
+ importance: 6,
95
+ path: '/topology',
96
+ cta: 'Open Topology',
97
+ },
98
+ {
99
+ id: 'better-pod-log-secret-debugging',
100
+ icon: Bug,
101
+ title: 'Better Pod, log and Secret debugging',
102
+ description: 'Start and reopen custom-image debug containers right from Pod details, stream ReplicaSet logs, copy Secret values unrevealed, and read any cert key.',
103
+ importance: 6,
104
+ },
105
+ {
106
+ id: 'more-metrics-sources',
107
+ icon: ChartLine,
108
+ title: 'OpenObserve, GKE and shared metrics stores',
109
+ description: 'Connect local Radar to shared OpenObserve, chart GKE system metrics via Managed Prometheus, and keep shared multi-cluster stores scoped cleanly.',
110
+ importance: 6,
111
+ },
112
+ ],
113
+ improvements: [
114
+ // The grid fills row by row: pair lines of similar length.
115
+ 'Match kubectl short names in the kind filter and Cmd-K, and see other-namespace counts on empty lists',
116
+ 'GitOps actions check missing permissions upfront and explain RBAC or admission refusals',
117
+ 'Flux flags sources ahead of what is applied, builds Activity from history, and follows ArtifactGenerators and dependsOn',
118
+ 'Traefik IngressRoute drawers show each rule path to ready backends, cert expiry and Middleware usage',
119
+ 'Stop or terminate Argo Workflows and submit WorkflowTemplates right from Radar',
120
+ 'Remote MCP clients can sign in with OAuth on standalone OIDC installs (--mcp-oauth / mcp.oauth.enabled)',
121
+ 'Beyla Live Traffic infers ports from Services and lets you hide node-to-node overlay UDP',
122
+ 'CloudNativePG Clusters gain a fleet backup/HA posture bar with one-click filters',
123
+ ],
124
+ },
51
125
  {
52
126
  version: 'v1.21.0',
53
127
  highlights: [
@@ -55,7 +55,7 @@ describe('application resource hosts', () => {
55
55
  'RolloutRenderer', 'KyvernoPolicyCoverage', 'KyvernoPolicyQueued', 'CNPGObjectStoreRenderer',
56
56
  'VeleroBSLRenderer', 'VeleroBackupRenderer', 'VeleroRestoreRenderer', 'CNPGClusterRenderer',
57
57
  'CNPGDatabaseRenderer', 'CNPGPublicationRenderer', 'CNPGSubscriptionRenderer', 'CNPGImageCatalogRenderer',
58
- 'FluxHelmReleaseRenderer', 'OpenTelemetryCollectorRenderer', 'ValidatingAdmissionPolicyRenderer', 'ValidatingAdmissionPolicyBindingRenderer', 'MutatingAdmissionPolicyRenderer', 'MutatingAdmissionPolicyBindingRenderer', 'SecretProviderClassRenderer', 'UpgradePlanRenderer', 'SealedSecretRenderer', 'K3sHelmChartRenderer',
58
+ 'FluxHelmReleaseRenderer', 'OpenTelemetryCollectorRenderer', 'ValidatingAdmissionPolicyRenderer', 'ValidatingAdmissionPolicyBindingRenderer', 'MutatingAdmissionPolicyRenderer', 'MutatingAdmissionPolicyBindingRenderer', 'SecretProviderClassRenderer', 'UpgradePlanRenderer', 'SealedSecretRenderer', 'K3sHelmChartRenderer', 'TraefikIngressRouteRenderer', 'TraefikMiddlewareRenderer',
59
59
  ].sort())
60
60
  const inherited = [{ id: 'local', label: 'Local', render: () => null }]
61
61
  expect(resourceDetailSlots({ kind: 'Pod', group: '', namespace: 'db', name: 'pg-1' }, inherited).extraTabs).toEqual(inherited)
@@ -41,6 +41,8 @@ import { LonghornVolumeRenderer } from '../components/resources/renderers/Longho
41
41
  import { FluxHelmReleaseRenderer } from '../components/resources/renderers/FluxHelmReleaseRenderer'
42
42
  import { SecretProviderClassRenderer } from '../components/resources/renderers/SecretProviderClassRenderer'
43
43
  import { SealedSecretRenderer } from '../components/resources/renderers/SealedSecretRenderer'
44
+ import { TraefikIngressRouteRenderer } from '../components/resources/renderers/TraefikIngressRouteRenderer'
45
+ import { TraefikMiddlewareRenderer } from '../components/resources/renderers/TraefikMiddlewareRenderer'
44
46
  import { K3sHelmChartRenderer } from '../components/resources/renderers/K3sHelmChartRenderer'
45
47
  import { UpgradePlanRenderer } from '../components/resources/renderers/UpgradePlanRenderer'
46
48
  import {
@@ -55,6 +57,7 @@ export const resourceHosts: readonly ResourceHost[] = [
55
57
  { id: 'gateway-api', renderers: { HTTPRouteRenderer } },
56
58
  { id: 'rbac', renderers: { ServiceAccountRenderer, RoleRenderer, RoleBindingRenderer, NamespaceRenderer } },
57
59
  { id: 'sealed-secrets', renderers: { SealedSecretRenderer } },
60
+ { id: 'traefik', renderers: { TraefikIngressRouteRenderer, TraefikMiddlewareRenderer } },
58
61
  { id: 'k3s-helm', renderers: { K3sHelmChartRenderer } },
59
62
  { id: 'system-upgrade', renderers: { UpgradePlanRenderer } },
60
63
  { id: 'batch-and-admission', renderers: { JobRenderer, JobSetRenderer, KueueWorkloadRenderer } },