@skyhook-io/radar-app 1.20.3 → 1.21.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.
Files changed (167) hide show
  1. package/package.json +10 -9
  2. package/src/App.tsx +67 -15
  3. package/src/api/client.audit-gating.test.tsx +105 -5
  4. package/src/api/client.auditBadgesSync.test.tsx +118 -0
  5. package/src/api/client.capabilitiesPoll.test.ts +61 -0
  6. package/src/api/client.ts +129 -5
  7. package/src/api/namespaceScopeRetry.test.ts +14 -0
  8. package/src/api/radarFeatures.ts +11 -0
  9. package/src/api/substrateHealth.ts +134 -0
  10. package/src/api/velero.test.ts +60 -0
  11. package/src/api/velero.ts +377 -0
  12. package/src/api/vulnerabilities.ts +313 -0
  13. package/src/components/NamespaceSwitcher.tsx +3 -1
  14. package/src/components/audit/AuditView.tsx +4 -0
  15. package/src/components/audit/ChecksViewTabs.test.tsx +35 -5
  16. package/src/components/audit/ChecksViewTabs.tsx +12 -1
  17. package/src/components/audit/Java4ShellPanel.test.tsx +31 -0
  18. package/src/components/audit/Java4ShellPanel.tsx +313 -0
  19. package/src/components/audit/UpgradeReadinessView.test.ts +35 -1
  20. package/src/components/audit/UpgradeReadinessView.tsx +60 -2
  21. package/src/components/audit/VulnerabilitiesView.tsx +944 -0
  22. package/src/components/cnpg/CNPGClusterTabs.tsx +3 -1
  23. package/src/components/cnpg/CNPGDrawerTrail.tsx +5 -26
  24. package/src/components/cnpg/CNPGInvestigationAction.test.tsx +27 -6
  25. package/src/components/cnpg/CNPGView.tsx +43 -117
  26. package/src/components/cnpg/CNPGWorkspace.compatibility.test.tsx +30 -0
  27. package/src/components/cnpg/host.tsx +2 -2
  28. package/src/components/cnpg/routes.ts +3 -1
  29. package/src/components/cnpg/shared.tsx +5 -53
  30. package/src/components/cnpg/useCNPGNavigate.ts +1 -21
  31. package/src/components/cnpg/useCNPGSidebarWorkspace.ts +16 -13
  32. package/src/components/community.tsx +42 -0
  33. package/src/components/diagnose/diagnoseEvidenceTypes.ts +2 -0
  34. package/src/components/diagnose/investigationMetrics.test.ts +20 -0
  35. package/src/components/diagnose/investigationMetrics.ts +2 -1
  36. package/src/components/dock/BottomDock.tsx +1 -0
  37. package/src/components/dock/LogsTab.tsx +3 -0
  38. package/src/components/gitops/FluxOperatorCard.test.tsx +37 -0
  39. package/src/components/gitops/FluxOperatorCard.tsx +27 -0
  40. package/src/components/gitops/GitOpsView.rowsSummary.test.tsx +59 -0
  41. package/src/components/gitops/GitOpsView.tsx +8 -5
  42. package/src/components/gitops/gitopsRowEvents.test.ts +48 -0
  43. package/src/components/gitops/gitopsRowEvents.ts +31 -0
  44. package/src/components/helm/HelmDrawerFrame.tsx +1 -1
  45. package/src/components/helm/HelmView.tsx +20 -16
  46. package/src/components/helm/OwnedResources.tsx +4 -3
  47. package/src/components/home/ClusterHealthCard.tsx +3 -1
  48. package/src/components/home/HomeAgentBlock.tsx +3 -0
  49. package/src/components/home/HomeView.tsx +7 -0
  50. package/src/components/home/MCPSetupDialog.test.tsx +19 -12
  51. package/src/components/home/MCPSetupDialog.tsx +4 -2
  52. package/src/components/home/mcpToolCatalog.ts +15 -2
  53. package/src/components/home/useVulnerabilitiesRow.test.ts +26 -0
  54. package/src/components/home/useVulnerabilitiesRow.ts +50 -0
  55. package/src/components/logs/LogsViewer.tsx +3 -1
  56. package/src/components/logs/MultiPodLogsTab.test.tsx +24 -4
  57. package/src/components/logs/MultiPodLogsTab.tsx +9 -5
  58. package/src/components/nav/PrimaryNavRail.test.tsx +17 -0
  59. package/src/components/nav/PrimaryNavRail.tsx +174 -29
  60. package/src/components/resource/PrometheusChartsGrid.tsx +5 -1
  61. package/src/components/resource/SubstrateHealthCharts.test.tsx +143 -0
  62. package/src/components/resource/SubstrateHealthCharts.tsx +254 -0
  63. package/src/components/resource/SubstrateVerdictLine.test.tsx +131 -0
  64. package/src/components/resource/SubstrateVerdictLine.tsx +180 -0
  65. package/src/components/resources/ResourcesView.tsx +12 -6
  66. package/src/components/resources/renderers/UpgradePlanRenderer.test.tsx +20 -0
  67. package/src/components/resources/renderers/UpgradePlanRenderer.tsx +22 -0
  68. package/src/components/resources/renderers/VeleroBackupRenderer.tsx +16 -36
  69. package/src/components/resources/renderers/VeleroRestoreRenderer.tsx +6 -19
  70. package/src/components/resources/renderers/WorkloadRenderer.tsx +8 -0
  71. package/src/components/rightsizing/RightsizingScanView.tsx +3 -2
  72. package/src/components/shared/LargeClusterNamespacePicker.test.tsx +27 -0
  73. package/src/components/shared/LargeClusterNamespacePicker.tsx +8 -2
  74. package/src/components/timeline/TimelineView.tsx +3 -1
  75. package/src/components/traffic/TrafficConnectionsTable.test.tsx +94 -0
  76. package/src/components/traffic/TrafficConnectionsTable.tsx +21 -5
  77. package/src/components/traffic/TrafficData.test.tsx +37 -0
  78. package/src/components/traffic/TrafficData.tsx +27 -0
  79. package/src/components/traffic/TrafficFlowList.tsx +9 -7
  80. package/src/components/traffic/TrafficGraph.layoutEngine.test.tsx +193 -0
  81. package/src/components/traffic/TrafficGraph.test.tsx +269 -0
  82. package/src/components/traffic/TrafficGraph.tsx +135 -64
  83. package/src/components/traffic/TrafficGraphUnavailable.tsx +57 -0
  84. package/src/components/traffic/TrafficView.layoutUnavailable.test.tsx +211 -0
  85. package/src/components/traffic/TrafficView.tsx +46 -129
  86. package/src/components/traffic/trafficFilters.test.ts +172 -1
  87. package/src/components/traffic/trafficFilters.ts +139 -0
  88. package/src/components/ui/DiagnosticsOverlay.tsx +14 -1
  89. package/src/components/ui/UpdateNotification.manual.test.tsx +5 -2
  90. package/src/components/ui/UpdateNotification.test.tsx +31 -2
  91. package/src/components/ui/UpdateNotification.tsx +34 -17
  92. package/src/components/ui/command-items.ts +24 -1
  93. package/src/components/velero/VeleroBackupNow.test.tsx +165 -0
  94. package/src/components/velero/VeleroBackupNow.tsx +143 -0
  95. package/src/components/velero/VeleroDeleteBackup.test.tsx +364 -0
  96. package/src/components/velero/VeleroDeleteBackup.tsx +306 -0
  97. package/src/components/velero/VeleroDetailPage.tsx +158 -0
  98. package/src/components/velero/VeleroKindLists.test.tsx +48 -0
  99. package/src/components/velero/VeleroKindLists.tsx +43 -0
  100. package/src/components/velero/VeleroLocations.expand.test.tsx +27 -0
  101. package/src/components/velero/VeleroLocations.test.tsx +86 -0
  102. package/src/components/velero/VeleroLocations.tsx +240 -0
  103. package/src/components/velero/VeleroOverview.test.tsx +311 -0
  104. package/src/components/velero/VeleroOverview.tsx +485 -0
  105. package/src/components/velero/VeleroPages.test.tsx +516 -0
  106. package/src/components/velero/VeleroPages.tsx +1056 -0
  107. package/src/components/velero/VeleroRunArtifacts.test.tsx +241 -0
  108. package/src/components/velero/VeleroRunArtifacts.tsx +112 -0
  109. package/src/components/velero/VeleroRunLists.tsx +309 -0
  110. package/src/components/velero/VeleroRunMessagesHost.test.tsx +25 -0
  111. package/src/components/velero/VeleroRunMessagesHost.tsx +54 -0
  112. package/src/components/velero/VeleroRunVolumes.test.tsx +247 -0
  113. package/src/components/velero/VeleroRunVolumes.tsx +122 -0
  114. package/src/components/velero/VeleroSchedulePause.test.tsx +211 -0
  115. package/src/components/velero/VeleroSchedulePause.tsx +191 -0
  116. package/src/components/velero/VeleroScheduleStatusBadge.test.tsx +28 -0
  117. package/src/components/velero/VeleroScheduleStatusBadge.tsx +21 -0
  118. package/src/components/velero/VeleroSchedules.tsx +255 -0
  119. package/src/components/velero/VeleroView.tsx +59 -0
  120. package/src/components/velero/VeleroWorkspace.gate.test.tsx +97 -0
  121. package/src/components/velero/attention.test.ts +178 -0
  122. package/src/components/velero/attention.ts +281 -0
  123. package/src/components/velero/backupDelete.test.tsx +91 -0
  124. package/src/components/velero/backupDelete.tsx +182 -0
  125. package/src/components/velero/coverage.test.ts +87 -0
  126. package/src/components/velero/coverage.ts +150 -0
  127. package/src/components/velero/host.tsx +92 -0
  128. package/src/components/velero/routes.ts +78 -0
  129. package/src/components/velero/runs.tsx +121 -0
  130. package/src/components/velero/shared.test.ts +84 -0
  131. package/src/components/velero/shared.tsx +423 -0
  132. package/src/components/velero/useVeleroSidebarWorkspace.test.tsx +28 -0
  133. package/src/components/velero/useVeleroSidebarWorkspace.ts +71 -0
  134. package/src/components/velero/velero.fixtures.ts +61 -0
  135. package/src/components/velero/workspaceRoute.ts +21 -0
  136. package/src/components/vulnerabilities/WorkloadVulnerabilitiesSection.tsx +179 -0
  137. package/src/components/vulnerabilities/parts.test.ts +72 -0
  138. package/src/components/vulnerabilities/parts.tsx +291 -0
  139. package/src/components/whats-new/WhatsNewDialog.test.tsx +6 -4
  140. package/src/components/whats-new/releaseNotes.ts +67 -1
  141. package/src/components/workload/WorkloadView.tsx +64 -27
  142. package/src/components/workspace/DrawerTrailBack.tsx +32 -0
  143. package/src/components/workspace/WorkspaceFrame.tsx +71 -0
  144. package/src/components/workspace/coverage.ts +61 -0
  145. package/src/components/workspace/layout.test.tsx +29 -1
  146. package/src/components/workspace/layout.tsx +15 -5
  147. package/src/components/workspace/sidebar.ts +9 -0
  148. package/src/components/workspace/useWorkspaceDrawer.ts +63 -0
  149. package/src/components/workspace/useWorkspaceNavigate.ts +21 -0
  150. package/src/desktop/AboutDialog.test.ts +12 -0
  151. package/src/desktop/AboutDialog.tsx +151 -0
  152. package/src/desktop/WindowsTitleBar.tsx +359 -0
  153. package/src/desktop/titleBar.test.ts +61 -0
  154. package/src/desktop/titleBar.ts +45 -0
  155. package/src/index.css +19 -0
  156. package/src/integrations/resourceHost.ts +5 -1
  157. package/src/integrations/resourceHosts.test.tsx +14 -2
  158. package/src/integrations/resourceHosts.tsx +22 -6
  159. package/src/integrations/workspaceRoute.ts +1 -1
  160. package/src/integrations/workspaceRoutes.test.ts +11 -0
  161. package/src/integrations/workspaceRoutes.ts +3 -1
  162. package/src/integrations/workspaceScreens.tsx +2 -0
  163. package/src/main.tsx +8 -0
  164. package/src/utils/desktop-zoom.test.ts +53 -0
  165. package/src/utils/desktop-zoom.ts +30 -0
  166. package/src/utils/staleAssetPrompt.test.tsx +76 -0
  167. package/src/utils/staleAssetPrompt.tsx +32 -0
@@ -258,7 +258,8 @@ function producerRelatives(
258
258
  };
259
259
  if (!sameResource(ref, subject)) break;
260
260
  const uses = data.resourceContext?.uses;
261
- relatives.push(...(uses?.configMaps ?? []), ...(uses?.secrets ?? []));
261
+ // A reference the caller may not read is named only; its history isn't theirs to follow.
262
+ relatives.push(...[...(uses?.configMaps ?? []), ...(uses?.secrets ?? [])].filter((r) => !r.state));
262
263
  if (data.resourceContext?.owner) {
263
264
  relatives.push(data.resourceContext.owner);
264
265
  }
@@ -31,6 +31,7 @@ function renderTabContent(tab: DockTab, isActive: boolean, viewNamespaces: strin
31
31
  podName={tab.podName!}
32
32
  containers={tab.containers!}
33
33
  initialContainer={tab.containerName}
34
+ initContainers={tab.initContainers}
34
35
  />
35
36
  )
36
37
  }
@@ -5,6 +5,7 @@ interface LogsTabProps {
5
5
  podName: string
6
6
  containers: string[]
7
7
  initialContainer?: string
8
+ initContainers?: string[]
8
9
  }
9
10
 
10
11
  export function LogsTab({
@@ -12,6 +13,7 @@ export function LogsTab({
12
13
  podName,
13
14
  containers,
14
15
  initialContainer,
16
+ initContainers,
15
17
  }: LogsTabProps) {
16
18
  return (
17
19
  <div className="h-full">
@@ -20,6 +22,7 @@ export function LogsTab({
20
22
  podName={podName}
21
23
  containers={containers}
22
24
  initialContainer={initialContainer}
25
+ initContainers={initContainers}
23
26
  />
24
27
  </div>
25
28
  )
@@ -0,0 +1,37 @@
1
+ import { describe, expect, it, vi } from 'vitest'
2
+ import { renderToString } from 'react-dom/server'
3
+ import { MemoryRouter } from 'react-router-dom'
4
+
5
+ const state: { reports: any; options: Record<string, any> } = { reports: { data: undefined, error: null, isSuccess: false }, options: {} }
6
+ vi.mock('../../api/client', () => ({
7
+ useResources: (kind: string, _ns?: string, _group?: string, options?: any) => {
8
+ state.options[kind] = options
9
+ return kind === 'fluxreports' ? state.reports : { data: undefined, error: null, isSuccess: false }
10
+ },
11
+ }))
12
+
13
+ import { FluxOperatorCard } from './FluxOperatorCard'
14
+
15
+ const render = () => renderToString(<MemoryRouter><FluxOperatorCard available /></MemoryRouter>).replace(/<!-- -->/g, '')
16
+ const report = { metadata: { namespace: 'flux-system', name: 'flux' }, spec: { distribution: { version: 'v2.7.5' }, components: [], reconcilers: [] } }
17
+
18
+ describe('FluxOperatorCard', () => {
19
+ it('shows nothing when the report list failed or is empty', () => {
20
+ state.reports = { data: undefined, error: new Error('forbidden'), isSuccess: false }
21
+ expect(render()).not.toContain('Flux v')
22
+ state.reports = { data: [], error: null, isSuccess: true }
23
+ expect(render()).toBe('')
24
+ })
25
+
26
+ it('shows the card for a readable report', () => {
27
+ state.reports = { data: [report], error: null, isSuccess: true }
28
+ expect(render()).toContain('Flux v2.7.5')
29
+ })
30
+
31
+ it('refreshes the report and its FluxInstance at the same interval', () => {
32
+ state.reports = { data: [report], error: null, isSuccess: true }
33
+ renderToString(<MemoryRouter><FluxOperatorCard available refetchInterval={120_000} /></MemoryRouter>)
34
+ expect(state.options.fluxreports.refetchInterval).toBe(120_000)
35
+ expect(state.options.fluxinstances.refetchInterval).toBe(120_000)
36
+ })
37
+ })
@@ -0,0 +1,27 @@
1
+ import { useNavigate } from 'react-router-dom'
2
+ import { FluxReportCard } from '@skyhook-io/k8s-ui'
3
+ import { pickFluxReport, summarizeFluxReport } from '@skyhook-io/k8s-ui/utils/flux-report'
4
+ import { useResources } from '../../api/client'
5
+ import { relatedResourcePath } from '../../utils/navigation'
6
+
7
+ const GROUP = 'fluxcd.controlplane.io'
8
+
9
+ // FluxOperatorCard shows Flux Operator's FluxReport above the GitOps table,
10
+ // read as the caller. No readable report means no card: never zeros for
11
+ // "couldn't read".
12
+ export function FluxOperatorCard({ available, refetchInterval }: { available: boolean; refetchInterval?: number }) {
13
+ const navigate = useNavigate()
14
+ const reports = useResources<any>('fluxreports', undefined, GROUP, { enabled: available, refetchInterval })
15
+ const picked = reports.isSuccess && !reports.error ? pickFluxReport(reports.data ?? []) : null
16
+ const namespace = picked?.report.metadata?.namespace
17
+ const instances = useResources<any>('fluxinstances', namespace, GROUP, { enabled: available && !!namespace, refetchInterval })
18
+ if (!picked) return null
19
+ const instance = instances.isSuccess ? instances.data?.[0] : undefined
20
+ return (
21
+ <FluxReportCard
22
+ summary={summarizeFluxReport(picked.report, picked.total)}
23
+ instance={instance ? { namespace: instance.metadata?.namespace, name: instance.metadata?.name, version: instance.spec?.distribution?.version } : null}
24
+ onOpenResource={(ref) => navigate(relatedResourcePath(ref))}
25
+ />
26
+ )
27
+ }
@@ -0,0 +1,59 @@
1
+ // @vitest-environment jsdom
2
+ import { act } from 'react'
3
+ import { createRoot } from 'react-dom/client'
4
+ import { MemoryRouter } from 'react-router-dom'
5
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
6
+ import { afterEach, expect, it, vi } from 'vitest'
7
+ import { GitOpsView } from './GitOpsView'
8
+
9
+ // The table polls every row kind, so each list must ask the server for the
10
+ // summary shape: full Applications and Kustomizations carry status.resources
11
+ // and status.inventory, which the rows never read.
12
+
13
+ const lists = vi.hoisted(() => vi.fn())
14
+ vi.mock('../../api/client', async (importOriginal) => ({
15
+ ...(await importOriginal<typeof import('../../api/client')>()),
16
+ fetchResourceList: (kind: string, options: unknown) => {
17
+ lists(kind, options)
18
+ return Promise.resolve({ items: [], coverage: { status: 'complete' } })
19
+ },
20
+ }))
21
+ vi.mock('../../api/apiResources', async (importOriginal) => ({
22
+ ...(await importOriginal<typeof import('../../api/apiResources')>()),
23
+ useAPIResources: () => ({
24
+ data: [
25
+ { name: 'applications', group: 'argoproj.io' },
26
+ { name: 'kustomizations', group: 'kustomize.toolkit.fluxcd.io' },
27
+ { name: 'helmreleases', group: 'helm.toolkit.fluxcd.io' },
28
+ { name: 'gitrepositories', group: 'source.toolkit.fluxcd.io' },
29
+ ],
30
+ isLoading: false,
31
+ }),
32
+ }))
33
+ vi.mock('../ui/Toast', () => ({ useToast: () => ({ showError: vi.fn(), showSuccess: vi.fn(), showToast: vi.fn() }) }))
34
+ vi.mock('../../context/ConnectionContext', () => ({ useConnection: () => ({ connection: { state: 'connected' } }) }))
35
+ vi.mock('../../context/RadarUpgradeHost', () => ({ useRadarUpgradeHost: () => ({}) }))
36
+ vi.mock('../useContextSwitchFlow', () => ({ useContextSwitchFlow: () => ({ confirmDialog: null, requestSwitch: vi.fn() }) }))
37
+ vi.mock('../../hooks/useKeyboardShortcuts', () => ({ useRegisterShortcut: () => {} }))
38
+ vi.mock('../../hooks/usePreviousIntegrationSettings', () => ({ usePreviousIntegrationSettings: () => ({}), previousSettingsNote: () => undefined }))
39
+ vi.stubGlobal('IS_REACT_ACT_ENVIRONMENT', true)
40
+
41
+ afterEach(() => { document.body.innerHTML = '' })
42
+
43
+ it('lists every GitOps row kind in the summary shape', async () => {
44
+ vi.stubGlobal('fetch', vi.fn(() => new Promise<Response>(() => {})))
45
+ const client = new QueryClient({ defaultOptions: { queries: { retry: false } } })
46
+ const host = document.createElement('div')
47
+ document.body.append(host)
48
+ const root = createRoot(host)
49
+ await act(async () => root.render(
50
+ <MemoryRouter initialEntries={['/gitops']}>
51
+ <QueryClientProvider client={client}><GitOpsView namespaces={[]} onOpenResource={() => {}} /></QueryClientProvider>
52
+ </MemoryRouter>,
53
+ ))
54
+ await act(async () => { await new Promise((resolve) => setTimeout(resolve, 0)) })
55
+ expect(lists.mock.calls.map(([kind]) => kind).sort()).toEqual(['applications', 'gitrepositories', 'helmreleases', 'kustomizations'])
56
+ for (const [, options] of lists.mock.calls) expect(options).toMatchObject({ summary: true })
57
+ await act(async () => root.unmount())
58
+ client.clear()
59
+ })
@@ -59,6 +59,7 @@ import {
59
59
  } from '@skyhook-io/k8s-ui'
60
60
  import { useToast } from '../ui/Toast'
61
61
  import { useContextSwitchFlow } from '../useContextSwitchFlow'
62
+ import { FluxOperatorCard } from './FluxOperatorCard'
62
63
  import { useDestinationCluster } from './useDestinationCluster'
63
64
  import { destinationToast } from './destination-toast'
64
65
 
@@ -103,9 +104,7 @@ type ArgoSyncDialogTarget =
103
104
 
104
105
  const KIND_BY_NAME = new Map(GITOPS_KINDS.map((k) => [k.name, k]))
105
106
 
106
- // Rows are the table's primary content; their poll cadence is what the toolbar
107
- // freshness signal advertises ("Auto-refreshes every 2m"). Single source of
108
- // truth so the signal can't drift from the actual refetchInterval below.
107
+ // Fallback poll for the rows; SSE changes to row kinds refetch them within 15s (App.tsx slow tier).
109
108
  const GITOPS_ROWS_REFRESH_INTERVAL_MS = 120_000
110
109
 
111
110
  interface ResourceCountsResponse {
@@ -137,6 +136,7 @@ function GitOpsTableView({ namespaces, onClearNamespaces }: { namespaces: string
137
136
  const { connection } = useConnection()
138
137
  const namespacesParam = namespaces.join(',')
139
138
  const { data: apiResources, isLoading: apiResourcesLoading } = useAPIResources()
139
+ const fluxReportsServed = !!apiResources?.some((r) => r.name === 'fluxreports' && r.group === 'fluxcd.controlplane.io')
140
140
 
141
141
  const argoSync = useArgoSync()
142
142
  const argoRefresh = useArgoRefresh()
@@ -202,7 +202,9 @@ function GitOpsTableView({ namespaces, onClearNamespaces }: { namespaces: string
202
202
  const failures: unknown[] = []
203
203
  const fetchResourceList = async (kind: string, group: string, namespacesParam: string): Promise<any[]> => {
204
204
  try {
205
- const result = await fetchCoveredResourceList<any>(kind, { group, namespaces: namespacesParam ? namespacesParam.split(',') : [] })
205
+ // Summary drops status.resources / status.inventory, which the rows
206
+ // never read and which dominate the payload on large fleets.
207
+ const result = await fetchCoveredResourceList<any>(kind, { group, namespaces: namespacesParam ? namespacesParam.split(',') : [], summary: true })
206
208
  coverage.push(result.coverage)
207
209
  return result.items
208
210
  } catch (error) {
@@ -337,6 +339,7 @@ function GitOpsTableView({ namespaces, onClearNamespaces }: { namespaces: string
337
339
  return (
338
340
  <>
339
341
  <SharedGitOpsTableView
342
+ headerSlot={fluxReportsServed ? <FluxOperatorCard available refetchInterval={GITOPS_ROWS_REFRESH_INTERVAL_MS} /> : undefined}
340
343
  rows={rowsQuery.data?.rows ?? []}
341
344
  coverageStatus={rowsQuery.data?.coverageStatus ?? 'unknown'}
342
345
  loading={apiResourcesLoading || countsQuery.isLoading || rowsQuery.isLoading || coldRetrying}
@@ -563,7 +566,7 @@ function GitOpsDetailView({ namespaces, onOpenResource, onOpenSettings }: GitOps
563
566
  if (node?.missing) {
564
567
  const nextStep = node.sync === 'Synced'
565
568
  ? 'Argo reports it as synced. Refresh the application to check its status.'
566
- : 'Sync the application to create it.'
569
+ : 'Review the desired changes and sync policy before deciding whether to sync.'
567
570
  showToast(`${ref.kind} ${ref.name} is not present in this cluster. ${nextStep}`, { type: 'info' })
568
571
  return
569
572
  }
@@ -0,0 +1,48 @@
1
+ import { describe, expect, it } from 'vitest'
2
+ import { isGitOpsCountGroup } from '@skyhook-io/k8s-ui'
3
+ import { changesGitOpsRow, gitopsTableChange } from './gitopsRowEvents'
4
+
5
+ describe('changesGitOpsRow', () => {
6
+ it('matches the kinds the GitOps table lists', () => {
7
+ expect(changesGitOpsRow('Application', 'argoproj.io')).toBe(true)
8
+ expect(changesGitOpsRow('ApplicationSet', 'argoproj.io')).toBe(true)
9
+ expect(changesGitOpsRow('Kustomization', 'kustomize.toolkit.fluxcd.io')).toBe(true)
10
+ expect(changesGitOpsRow('HelmRelease', 'helm.toolkit.fluxcd.io')).toBe(true)
11
+ })
12
+
13
+ it('matches the Flux sources whose URLs the rows show', () => {
14
+ for (const kind of ['GitRepository', 'HelmRepository', 'OCIRepository', 'Bucket']) {
15
+ expect(changesGitOpsRow(kind, 'source.toolkit.fluxcd.io')).toBe(true)
16
+ }
17
+ expect(changesGitOpsRow('Alert', 'notification.toolkit.fluxcd.io')).toBe(false)
18
+ })
19
+
20
+ it('ignores other Argo kinds and same-named kinds from other groups', () => {
21
+ expect(changesGitOpsRow('Rollout', 'argoproj.io')).toBe(false)
22
+ expect(changesGitOpsRow('Workflow', 'argoproj.io')).toBe(false)
23
+ expect(changesGitOpsRow('Application', 'app.k8s.io')).toBe(false)
24
+ expect(changesGitOpsRow('Kustomization', 'kustomize.config.k8s.io')).toBe(false)
25
+ expect(changesGitOpsRow('HelmRelease', undefined)).toBe(false)
26
+ })
27
+ })
28
+
29
+ describe('isGitOpsCountGroup', () => {
30
+ it('covers every group the GitOps totals count, and nothing else', () => {
31
+ for (const group of ['argoproj.io', 'source.toolkit.fluxcd.io', 'kustomize.toolkit.fluxcd.io', 'helm.toolkit.fluxcd.io', 'notification.toolkit.fluxcd.io']) {
32
+ expect(isGitOpsCountGroup(group)).toBe(true)
33
+ }
34
+ expect(isGitOpsCountGroup('apps')).toBe(false)
35
+ expect(isGitOpsCountGroup('')).toBe(false)
36
+ expect(isGitOpsCountGroup(undefined)).toBe(false)
37
+ })
38
+ })
39
+
40
+ describe('gitopsTableChange', () => {
41
+ it('refreshes rows on any row change but totals only on add or delete', () => {
42
+ expect(gitopsTableChange('Application', 'argoproj.io', 'update')).toEqual({ rows: true, counts: false })
43
+ expect(gitopsTableChange('Application', 'argoproj.io', 'add')).toEqual({ rows: true, counts: true })
44
+ expect(gitopsTableChange('Alert', 'notification.toolkit.fluxcd.io', 'delete')).toEqual({ rows: false, counts: true })
45
+ expect(gitopsTableChange('Alert', 'notification.toolkit.fluxcd.io', 'update')).toEqual({ rows: false, counts: false })
46
+ expect(gitopsTableChange('Deployment', 'apps', 'add')).toEqual({ rows: false, counts: false })
47
+ })
48
+ })
@@ -0,0 +1,31 @@
1
+ import { isGitOpsCountGroup } from '@skyhook-io/k8s-ui'
2
+
3
+ const FLUX_SOURCES = 'source.toolkit.fluxcd.io'
4
+
5
+ // Row kinds, plus the Flux sources whose URLs the rows show.
6
+ const ROW_KINDS: Record<string, string> = {
7
+ Application: 'argoproj.io',
8
+ ApplicationSet: 'argoproj.io',
9
+ Kustomization: 'kustomize.toolkit.fluxcd.io',
10
+ HelmRelease: 'helm.toolkit.fluxcd.io',
11
+ GitRepository: FLUX_SOURCES,
12
+ HelmRepository: FLUX_SOURCES,
13
+ OCIRepository: FLUX_SOURCES,
14
+ Bucket: FLUX_SOURCES,
15
+ }
16
+
17
+ /** Whether a resource change can alter a row of the GitOps table (its rows query is ['gitops-rows-main', …]). */
18
+ export function changesGitOpsRow(kind: string, group: string | undefined): boolean {
19
+ return ROW_KINDS[kind] !== undefined && ROW_KINDS[kind] === group
20
+ }
21
+
22
+ /**
23
+ * What a resource change makes stale in the GitOps table: its rows, and on an
24
+ * add or delete its totals. A status update never changes a total.
25
+ */
26
+ export function gitopsTableChange(kind: string, group: string | undefined, operation: string): { rows: boolean; counts: boolean } {
27
+ return {
28
+ rows: changesGitOpsRow(kind, group),
29
+ counts: (operation === 'add' || operation === 'delete') && isGitOpsCountGroup(group),
30
+ }
31
+ }
@@ -84,7 +84,7 @@ export function HelmDrawerFrame({ onClose, isOpen, rightInset, children }: HelmD
84
84
  TRANSITION_DRAWER,
85
85
  isOpen ? 'translate-x-0 opacity-100' : 'translate-x-full opacity-0'
86
86
  )}
87
- style={{ width: renderedDrawerWidth, top: HEADER_HEIGHT, right: rightInset, height: `calc(100vh - ${HEADER_HEIGHT}px - ${dockInset}px)` }}
87
+ style={{ width: renderedDrawerWidth, top: `calc(${HEADER_HEIGHT}px + var(--radar-titlebar-h, 0px))`, right: rightInset, height: `calc(100vh - var(--radar-titlebar-h, 0px) - ${HEADER_HEIGHT}px - ${dockInset}px)` }}
88
88
  >
89
89
  {/* Resize handle */}
90
90
  <div
@@ -14,6 +14,10 @@ import { InstallWizard } from './InstallWizard'
14
14
  import { ObservedHelmNotice } from './ObservedHelmNotice'
15
15
  import { NotCheckedBadge } from './NotCheckedBadge'
16
16
 
17
+ // The list tables' density (TABLE_DENSITY in k8s-ui's table-density.ts), repeated:
18
+ // radar-app supports k8s-ui releases older than that module.
19
+ const HELM_CELL = 'px-3.5 py-2.5'
20
+
17
21
  type ViewTab = 'releases' | 'charts'
18
22
 
19
23
  interface HelmViewProps {
@@ -255,7 +259,7 @@ export function HelmView({ namespaces, selectedRelease, onReleaseClick }: HelmVi
255
259
  {activeTab === 'releases' ? (
256
260
  <>
257
261
  {/* Releases Toolbar */}
258
- <div className="flex items-center gap-4 px-4 py-3 border-b border-theme-border bg-theme-surface/50 shrink-0">
262
+ <div className={clsx('flex items-center gap-4 border-b border-theme-border bg-theme-surface/50 shrink-0', 'px-4 py-2.5')}>
259
263
  <div className="flex-1 relative">
260
264
  <Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-theme-text-tertiary" />
261
265
  <Input
@@ -263,7 +267,7 @@ export function HelmView({ namespaces, selectedRelease, onReleaseClick }: HelmVi
263
267
  placeholder="Search releases..."
264
268
  value={searchTerm}
265
269
  onChange={(e) => setSearchTerm(e.target.value)}
266
- className="w-full max-w-md pl-10 pr-4 py-2 bg-theme-elevated border border-theme-border-light rounded-lg text-sm text-theme-text-primary placeholder-theme-text-disabled focus:outline-none focus:ring-2 focus:ring-blue-500"
270
+ className={clsx('w-full max-w-md pl-10 pr-4 bg-theme-elevated border border-theme-border-light rounded-lg text-sm text-theme-text-primary placeholder-theme-text-disabled focus:outline-none focus:ring-2 focus:ring-blue-500', 'py-1.5')}
267
271
  />
268
272
  </div>
269
273
  </div>
@@ -608,7 +612,7 @@ const ObservedReleaseRow = forwardRef<HTMLTableRowElement, ObservedReleaseRowPro
608
612
  : 'hover:bg-theme-surface/50'
609
613
  )}
610
614
  >
611
- <td className="px-4 py-3 phone:px-3">
615
+ <td className={clsx(HELM_CELL, 'phone:px-3')}>
612
616
  <div className="flex min-w-0 items-center gap-2 phone:flex-wrap phone:gap-y-1">
613
617
  <Package className="w-4 h-4 text-theme-text-tertiary shrink-0" />
614
618
  <span className="min-w-0 truncate text-sm font-medium text-theme-text-primary phone:max-w-[calc(100%-1.5rem)] phone:shrink-0">{release.name}</span>
@@ -617,17 +621,17 @@ const ObservedReleaseRow = forwardRef<HTMLTableRowElement, ObservedReleaseRowPro
617
621
  </div>
618
622
  <span className="hidden truncate pl-6 text-xs text-theme-text-tertiary phone:block">{release.namespace}</span>
619
623
  </td>
620
- <td className="px-4 py-3 w-[18%] phone:hidden">
624
+ <td className={clsx(HELM_CELL, 'w-[18%] phone:hidden')}>
621
625
  <Tooltip content={release.namespace}>
622
626
  <span className="block truncate text-sm text-theme-text-secondary">{release.namespace}</span>
623
627
  </Tooltip>
624
628
  </td>
625
- <td className="px-4 py-3 w-[22%] phone:hidden">
629
+ <td className={clsx(HELM_CELL, 'w-[22%] phone:hidden')}>
626
630
  <Tooltip content={chart.tooltip}>
627
631
  <span className={clsx('text-sm truncate block', chart.known ? 'text-theme-text-secondary' : 'text-theme-text-tertiary')}>{chart.text}</span>
628
632
  </Tooltip>
629
633
  </td>
630
- <td className="px-4 py-3 w-24 hidden xl:table-cell">
634
+ <td className={clsx(HELM_CELL, 'w-24 hidden xl:table-cell')}>
631
635
  {release.appVersion ? (
632
636
  <span className="text-sm text-theme-text-secondary">{release.appVersion}</span>
633
637
  ) : release.appVersions?.length ? (
@@ -640,7 +644,7 @@ const ObservedReleaseRow = forwardRef<HTMLTableRowElement, ObservedReleaseRowPro
640
644
  </Tooltip>
641
645
  )}
642
646
  </td>
643
- <td className="px-4 py-3 w-40 phone:w-[6.5rem] phone:px-3">
647
+ <td className={clsx(HELM_CELL, 'w-40 phone:w-[6.5rem] phone:px-3')}>
644
648
  <div className="flex flex-wrap items-center gap-1">
645
649
  <Tooltip content={UNREAD_FROM_HELM}>
646
650
  <span className={clsx('badge', SEVERITY_BADGE.neutral)}>Unknown</span>
@@ -654,10 +658,10 @@ const ObservedReleaseRow = forwardRef<HTMLTableRowElement, ObservedReleaseRowPro
654
658
  </td>
655
659
  {showHelmColumns && (
656
660
  <>
657
- <td className="px-4 py-3 w-16 phone:hidden">
661
+ <td className={clsx(HELM_CELL, 'w-16 phone:hidden')}>
658
662
  <CertaintyGlyph certainty="unknown" title={UNREAD_FROM_HELM} />
659
663
  </td>
660
- <td className="px-4 py-3 w-24 phone:hidden">
664
+ <td className={clsx(HELM_CELL, 'w-24 phone:hidden')}>
661
665
  <CertaintyGlyph certainty="unknown" title={UNREAD_FROM_HELM} />
662
666
  </td>
663
667
  </>
@@ -695,7 +699,7 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
695
699
  : 'hover:bg-theme-surface/50'
696
700
  )}
697
701
  >
698
- <td className="px-4 py-3 phone:px-3">
702
+ <td className={clsx(HELM_CELL, 'phone:px-3')}>
699
703
  <div className="flex min-w-0 items-center gap-2 phone:flex-wrap phone:gap-y-1">
700
704
  <Package className="w-4 h-4 text-theme-text-tertiary shrink-0" />
701
705
  <span className="min-w-0 truncate text-sm font-medium text-theme-text-primary phone:max-w-[calc(100%-1.5rem)] phone:shrink-0">{release.name}</span>
@@ -713,19 +717,19 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
713
717
  </div>
714
718
  <span className="hidden truncate pl-6 text-xs text-theme-text-tertiary phone:block">{release.namespace}</span>
715
719
  </td>
716
- <td className="px-4 py-3 w-[18%] phone:hidden">
720
+ <td className={clsx(HELM_CELL, 'w-[18%] phone:hidden')}>
717
721
  <Tooltip content={release.namespace}>
718
722
  <span className="block truncate text-sm text-theme-text-secondary">{release.namespace}</span>
719
723
  </Tooltip>
720
724
  </td>
721
- <td className="px-4 py-3 w-[22%] phone:hidden">
725
+ <td className={clsx(HELM_CELL, 'w-[22%] phone:hidden')}>
722
726
  <Tooltip content={`${release.chart}-${release.chartVersion}`}>
723
727
  <span className="text-sm text-theme-text-secondary truncate block">
724
728
  {release.chart}-{release.chartVersion}
725
729
  </span>
726
730
  </Tooltip>
727
731
  </td>
728
- <td className="px-4 py-3 w-24 hidden xl:table-cell">
732
+ <td className={clsx(HELM_CELL, 'w-24 hidden xl:table-cell')}>
729
733
  {release.appVersion ? (
730
734
  <span className="text-sm text-theme-text-secondary">{release.appVersion}</span>
731
735
  ) : (
@@ -734,7 +738,7 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
734
738
  </Tooltip>
735
739
  )}
736
740
  </td>
737
- <td className="px-4 py-3 w-40 phone:w-[6.5rem] phone:px-3">
741
+ <td className={clsx(HELM_CELL, 'w-40 phone:w-[6.5rem] phone:px-3')}>
738
742
  {isHelmReleaseActionable(release.status) ? (
739
743
  <Tooltip content="Click row to view rollback / history / logs and recover">
740
744
  <span
@@ -755,10 +759,10 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
755
759
  </span>
756
760
  )}
757
761
  </td>
758
- <td className="px-4 py-3 w-16 phone:hidden">
762
+ <td className={clsx(HELM_CELL, 'w-16 phone:hidden')}>
759
763
  <span className="text-sm text-theme-text-secondary">{release.revision}</span>
760
764
  </td>
761
- <td className="px-4 py-3 w-24 phone:hidden">
765
+ <td className={clsx(HELM_CELL, 'w-24 phone:hidden')}>
762
766
  <Tooltip content={release.updated}>
763
767
  <span className="text-sm text-theme-text-secondary">
764
768
  {formatAge(release.updated)}
@@ -12,7 +12,7 @@ import { PortForwardInlineButton } from '../portforward/PortForwardButton'
12
12
  import { useAvailablePorts } from '../../api/client'
13
13
  import { apiUrl, getAuthHeaders, getCredentialsMode } from '../../api/config'
14
14
  import { useNamespacedCapabilities, useIsLocalDeployment } from '../../contexts/CapabilitiesContext'
15
- import { pluralize, getExecContainerNames } from '@skyhook-io/k8s-ui'
15
+ import { pluralize, getExecContainerNames, getLogContainerNames, getDefaultLogContainerName, getInitContainerNames } from '@skyhook-io/k8s-ui'
16
16
  import { readActionFor } from '@skyhook-io/k8s-ui/utils/read-actions'
17
17
  import { Tooltip } from '../ui/Tooltip'
18
18
  import { notCheckedTooltip, type NotCheckedReason } from './NotCheckedBadge'
@@ -431,11 +431,12 @@ function PodQuickActions({ namespace, podName, isRunning }: PodQuickActionsProps
431
431
  setIsLoadingAction(true)
432
432
  try {
433
433
  const data = await fetchPodData()
434
- const containers = data.resource?.spec?.containers || []
435
434
  openLogs({
436
435
  namespace,
437
436
  podName,
438
- containers: containers.map((c: { name: string }) => c.name),
437
+ containers: getLogContainerNames(data.resource),
438
+ containerName: getDefaultLogContainerName(data.resource),
439
+ initContainers: getInitContainerNames(data.resource),
439
440
  })
440
441
  } catch (error) {
441
442
  console.error('Failed to open logs:', error)
@@ -42,6 +42,7 @@ interface ClusterHealthCardProps {
42
42
  // cluster metadata so the overview carries a freshness signal without a band.
43
43
  freshness?: ReactNode
44
44
  radarVersion?: ReactNode
45
+ vulnerabilityTools?: boolean
45
46
  }
46
47
 
47
48
  function getMetricsInstallHint(platform: string): string {
@@ -145,6 +146,7 @@ export function ClusterHealthCard({
145
146
  onIssuesClick,
146
147
  freshness,
147
148
  radarVersion,
149
+ vulnerabilityTools,
148
150
  }: ClusterHealthCardProps) {
149
151
  void _topCRDs // Reserved for future CRD display
150
152
 
@@ -304,7 +306,7 @@ export function ClusterHealthCard({
304
306
  (org-wide endpoint, PAT-authed) rather than per-cluster, so this
305
307
  localhost/no-auth entry would mislead a Cloud user. */}
306
308
  {showLocalMcpCard && (
307
- <HomeAgentBlock mcpUrl={mcpUrl} readOnly={caps.mcpReadOnly} execTools={caps.mcpExecTools} httpTools={caps.mcpHttpTools} helmTools={caps.mcpHelmTools} applicationEvidenceAvailable={caps.mcpApplicationEvidence} />
309
+ <HomeAgentBlock mcpUrl={mcpUrl} readOnly={caps.mcpReadOnly} execTools={caps.mcpExecTools} httpTools={caps.mcpHttpTools} helmTools={caps.mcpHelmTools} vulnerabilityTools={vulnerabilityTools} applicationEvidenceAvailable={caps.mcpApplicationEvidence} />
308
310
  )}
309
311
  </div>
310
312
 
@@ -16,6 +16,7 @@ export function HomeAgentBlock({
16
16
  execTools,
17
17
  httpTools,
18
18
  helmTools,
19
+ vulnerabilityTools,
19
20
  applicationEvidenceAvailable,
20
21
  }: {
21
22
  mcpUrl: string
@@ -24,6 +25,7 @@ export function HomeAgentBlock({
24
25
  httpTools?: boolean
25
26
  /** Whether the native Helm MCP tool is registered; target Kubernetes permissions still required. */
26
27
  helmTools?: boolean
28
+ vulnerabilityTools?: boolean
27
29
  applicationEvidenceAvailable?: boolean
28
30
  }) {
29
31
  const [mcpDialogOpen, setMcpDialogOpen] = useState(false)
@@ -61,6 +63,7 @@ export function HomeAgentBlock({
61
63
  execTools={execTools}
62
64
  httpTools={httpTools}
63
65
  helmTools={helmTools}
66
+ vulnerabilityTools={vulnerabilityTools}
64
67
  onInvestigate={showInvestigate && d.available ? () => openComposer(d) : undefined}
65
68
  applicationEvidenceAvailable={applicationEvidenceAvailable}
66
69
  />
@@ -11,6 +11,9 @@ import { CertificateHealthCard } from './CertificateHealthCard'
11
11
  import { NetworkPolicyCoverageCard } from './NetworkPolicyCoverageCard'
12
12
  import { CostCard } from './CostCard'
13
13
  import { GitOpsControllersCard } from './GitOpsControllersCard'
14
+ import { useVulnerabilitiesRow } from './useVulnerabilitiesRow'
15
+ import { useAPIResources } from '../../api/apiResources'
16
+ import { hasVulnerabilityReports } from '../../api/vulnerabilities'
14
17
  import { CapacityCard } from './CapacityCard'
15
18
  import { useCapabilitiesContext } from '../../contexts/CapabilitiesContext'
16
19
  import { Tooltip } from '../ui/Tooltip'
@@ -69,6 +72,8 @@ export function HomeView({ namespaces, topology, fallbackClusterLoadState, onNav
69
72
  const capacityCardPossible =
70
73
  karpenterState === 'available' || karpenterState === 'denied' || karpenterState === 'not_detected'
71
74
  const { data, isLoading, error, dataUpdatedAt, refetch } = useDashboard(namespaces)
75
+ const vulnerabilitiesRow = useVulnerabilitiesRow(namespaces)
76
+ const { data: apiResources } = useAPIResources()
72
77
  const { connection } = useConnection()
73
78
  const { data: issuesData, isLoading: issuesLoading, isFetching: issuesFetching, error: issuesError, refetch: refetchIssues } = useIssues(namespaces)
74
79
  const issues = issuesData?.issues ?? []
@@ -143,6 +148,7 @@ export function HomeView({ namespaces, topology, fallbackClusterLoadState, onNav
143
148
  )}
144
149
  {/* Row 1: Cluster Health Card (combined health + resource counts) */}
145
150
  <ClusterHealthCard
151
+ vulnerabilityTools={hasVulnerabilityReports(apiResources)}
146
152
  // A local install shows its version in Settings and upgrades through
147
153
  // the update notification; an in-cluster one is upgraded by whoever
148
154
  // manages it, and this line is where they confirm the new version.
@@ -264,6 +270,7 @@ export function HomeView({ namespaces, topology, fallbackClusterLoadState, onNav
264
270
  <AuditCard
265
271
  data={data.audit}
266
272
  onNavigate={() => onNavigateToView('checks')}
273
+ vulnerabilities={vulnerabilitiesRow}
267
274
  />
268
275
  </BandItem>
269
276
  )}