@skyhook-io/radar-app 1.17.1 → 1.18.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 +6 -0
- package/package.json +10 -11
- package/src/App.tsx +36 -36
- package/src/api/client.gitops-destination.test.tsx +55 -0
- package/src/api/client.gitopsPoll.test.ts +99 -0
- package/src/api/client.helmPreview.test.tsx +48 -0
- package/src/api/client.resource-list.test.ts +76 -0
- package/src/api/client.resourceAvailability.test.ts +24 -0
- package/src/api/client.ts +396 -105
- package/src/api/client.workloadRuns.test.ts +53 -0
- package/src/api/config.test.ts +23 -1
- package/src/api/config.ts +7 -3
- package/src/api/diagnose.ts +4 -1
- package/src/api/drain-plan.test.ts +70 -40
- package/src/api/policy.ts +5 -5
- package/src/api/quotas.ts +9 -20
- package/src/api/radarFeatures.ts +3 -0
- package/src/api/resourceLists.test.ts +84 -0
- package/src/api/resourceLists.ts +71 -0
- package/src/api/traffic.scope.render.test.tsx +60 -0
- package/src/api/traffic.ts +3 -1
- package/src/components/cnpg/CNPGSummaryHost.tsx +4 -3
- package/src/components/cnpg/CNPGView.tsx +1 -0
- package/src/components/compare/CompareResourcePicker.test.tsx +58 -0
- package/src/components/compare/CompareViewRoute.tsx +5 -1
- package/src/components/compare/useCompareCandidates.ts +1 -1
- package/src/components/compare/useCompareLauncher.tsx +4 -2
- package/src/components/diagnose/DiagnoseSurface.tsx +3 -3
- package/src/components/diagnose/InvestigationChangesEvidence.test.tsx +352 -0
- package/src/components/diagnose/InvestigationEvidencePane.test.tsx +101 -0
- package/src/components/diagnose/InvestigationView.tsx +2 -1
- package/src/components/diagnose/StoryExcerpt.tsx +24 -5
- package/src/components/diagnose/investigationEvidence/adapters/changes.test.ts +123 -0
- package/src/components/diagnose/investigationEvidence/adapters/changes.ts +192 -3
- package/src/components/diagnose/investigationEvidence/adapters/issues.ts +73 -51
- package/src/components/diagnose/investigationEvidence/adapters/listCoverage.test.ts +415 -0
- package/src/components/diagnose/investigationEvidence/adapters/prometheus.ts +64 -2
- package/src/components/diagnose/investigationEvidence/adapters/resource.test.ts +37 -0
- package/src/components/diagnose/investigationEvidence/adapters/resource.ts +107 -8
- package/src/components/diagnose/investigationEvidence/adapters/testdata/get-changes-created.json +323 -0
- package/src/components/diagnose/investigationEvidence/bodies/inventory.tsx +66 -16
- package/src/components/diagnose/investigationEvidence/bodies/streams.tsx +144 -15
- package/src/components/diagnose/investigationEvidence/builder.ts +13 -1
- package/src/components/diagnose/investigationEvidence/excerpt.ts +2 -0
- package/src/components/diagnose/investigationEvidence/observations.ts +21 -0
- package/src/components/diagnose/investigationEvidence/parse.ts +57 -1
- package/src/components/diagnose/investigationEvidence/projection.test.ts +131 -1
- package/src/components/diagnose/investigationEvidence/types.ts +26 -0
- package/src/components/diagnose/investigationEvidencePresentation.test.ts +18 -0
- package/src/components/diagnose/investigationState.test.ts +36 -1
- package/src/components/diagnose/investigationState.ts +8 -0
- package/src/components/diagnose/launch.ts +2 -2
- package/src/components/diagnose/toolCallLabel.test.ts +9 -0
- package/src/components/diagnose/toolCallLabel.ts +2 -0
- package/src/components/dock/BottomDock.tsx +6 -3
- package/src/components/dock/WorkloadLogsTab.tsx +3 -0
- package/src/components/execution/BatchExecutionView.image-browse.test.tsx +46 -0
- package/src/components/execution/BatchExecutionView.render.test.tsx +29 -1
- package/src/components/execution/BatchExecutionView.tsx +28 -11
- package/src/components/execution/cluster-template-runs.render.test.tsx +42 -0
- package/src/components/gitops/GitOpsView.identity.test.tsx +113 -0
- package/src/components/gitops/GitOpsView.tsx +69 -40
- package/src/components/gitops/useDestinationCluster.ts +2 -1
- package/src/components/helm/ArtifactHubSourceSearch.test.tsx +124 -0
- package/src/components/helm/ArtifactHubSourceSearch.tsx +240 -0
- package/src/components/helm/ChartBrowser.tsx +5 -4
- package/src/components/helm/HelmReleaseDrawer.tsx +139 -55
- package/src/components/helm/HelmReleaseNotes.test.tsx +42 -0
- package/src/components/helm/HelmReleaseNotes.tsx +26 -0
- package/src/components/helm/OwnedResources.tsx +2 -2
- package/src/components/helm/TrackChartSourceDialog.render.test.tsx +295 -50
- package/src/components/helm/TrackChartSourceDialog.test.ts +3 -2
- package/src/components/helm/TrackChartSourceDialog.tsx +614 -85
- package/src/components/helm/ValuesDiffPreview.tsx +4 -1
- package/src/components/home/ClusterHealthCard.tsx +4 -4
- package/src/components/home/CostCard.test.tsx +100 -0
- package/src/components/home/CostCard.tsx +2 -2
- package/src/components/home/HelmSummary.tsx +2 -2
- package/src/components/home/HomeView.tsx +15 -6
- package/src/components/home/MCPSetupDialog.test.tsx +30 -0
- package/src/components/home/MCPSetupDialog.tsx +13 -6
- package/src/components/home/ProblemsPanel.test.tsx +1 -0
- package/src/components/home/mcpToolCatalog.ts +28 -2
- package/src/components/issues/IssuesPane.render.test.tsx +21 -0
- package/src/components/issues/IssuesPane.tsx +31 -7
- package/src/components/issues/UncheckedSourceHelp.test.tsx +42 -0
- package/src/components/issues/UncheckedSourceHelp.tsx +24 -0
- package/src/components/issues/uncheckedSources.test.ts +43 -0
- package/src/components/issues/uncheckedSources.ts +58 -5
- package/src/components/logs/ScheduledWorkloadLogsViewer.tsx +4 -2
- package/src/components/resource/PrometheusCharts.overlays.test.ts +45 -0
- package/src/components/resource/PrometheusCharts.tsx +2 -2
- package/src/components/resources/ImageFilesystemModal.test.tsx +68 -0
- package/src/components/resources/ImageFilesystemModal.tsx +11 -4
- package/src/components/resources/PodFilesystemModal.tsx +2 -2
- package/src/components/resources/ResourcesView.scope.render.test.tsx +58 -0
- package/src/components/resources/ResourcesView.tsx +46 -69
- package/src/components/resources/renderers/FluxHelmReleaseRenderer.test.tsx +111 -0
- package/src/components/resources/renderers/FluxHelmReleaseRenderer.tsx +67 -0
- package/src/components/resources/renderers/KyvernoPolicyCoverage.scope.render.test.tsx +64 -0
- package/src/components/resources/renderers/KyvernoPolicyCoverage.tsx +6 -7
- package/src/components/resources/renderers/PodRenderer.tsx +4 -1
- package/src/components/settings/MyPermissionsDialog.tsx +12 -9
- package/src/components/settings/SettingsDialog.tsx +21 -15
- package/src/components/traffic/TrafficFilterSidebar.test.tsx +77 -0
- package/src/components/traffic/TrafficFilterSidebar.tsx +42 -31
- package/src/components/traffic/TrafficSourcePill.test.tsx +110 -0
- package/src/components/traffic/TrafficSourcePill.tsx +111 -0
- package/src/components/traffic/TrafficView.tsx +21 -67
- package/src/components/traffic/trafficFilters.test.ts +20 -1
- package/src/components/traffic/trafficFilters.ts +13 -0
- package/src/components/ui/DiagnosticsOverlay.test.ts +25 -0
- package/src/components/ui/DiagnosticsOverlay.tsx +2 -1
- package/src/components/ui/Omnibar.note.test.tsx +141 -0
- package/src/components/ui/Omnibar.tsx +89 -14
- package/src/components/ui/RadarOmnibar.test.tsx +183 -0
- package/src/components/ui/RadarOmnibar.tsx +38 -4
- package/src/components/ui/Toast.tsx +1 -1
- package/src/components/ui/UpdateNotification.manual.test.tsx +177 -0
- package/src/components/ui/UpdateNotification.test.tsx +2 -1
- package/src/components/ui/UpdateNotification.tsx +29 -5
- package/src/components/ui/omnibar-match.test.ts +37 -0
- package/src/components/ui/omnibar-match.ts +23 -0
- package/src/components/ui/searchCoverage.fixtures.ts +16 -0
- package/src/components/ui/searchCoverageNote.test.ts +245 -0
- package/src/components/ui/searchCoverageNote.ts +222 -0
- package/src/components/whats-new/WhatsNew.test.ts +10 -0
- package/src/components/whats-new/WhatsNew.tsx +5 -4
- package/src/components/whats-new/WhatsNewDialog.test.tsx +20 -0
- package/src/components/whats-new/releaseNotes.ts +57 -5
- package/src/components/workload/CronJobSchedulingEvidence.test.tsx +35 -0
- package/src/components/workload/CronJobSchedulingEvidence.tsx +37 -0
- package/src/components/workload/NodeDrainStatus.test.tsx +253 -0
- package/src/components/workload/NodeDrainStatus.tsx +55 -0
- package/src/components/workload/WorkloadView.tsx +43 -5
- package/src/context/ConnectionContext.test.ts +27 -1
- package/src/context/ConnectionContext.tsx +17 -7
- package/src/hooks/useResourceCounts.ts +2 -0
- package/src/index.css +2 -4
- package/src/index.ts +7 -0
- package/src/integrations/resourceHosts.test.tsx +1 -0
- package/src/integrations/resourceHosts.tsx +2 -0
- package/src/utils/artifacthub.test.ts +18 -0
- package/src/utils/artifacthub.ts +9 -0
- package/src/utils/navigation.ts +14 -0
- package/src/utils/wails-clipboard.ts +4 -2
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
import type { ServicePortRenderProps } from '@skyhook-io/k8s-ui/components/resources/renderers/ServiceRenderer'
|
|
37
37
|
import { isJobSetV1Alpha2 } from '@skyhook-io/k8s-ui/components/resources/resource-utils-jobset-lws'
|
|
38
38
|
import type { SelectedResource, ResourceRef, Relationships, ResourceWithRelationships } from '../../types'
|
|
39
|
+
import { CronJobSchedulingContext, CronJobSchedulingDetails } from './CronJobSchedulingEvidence'
|
|
39
40
|
import { useHistoryPaging } from './historyPaging'
|
|
40
41
|
import { findInheritedGitOpsLookupRef, useResolvedGitOpsOwner } from '../../hooks/useResolvedGitOpsOwner'
|
|
41
42
|
import { useGitOpsWriteGuard } from '../../hooks/useGitOpsWriteGuard'
|
|
@@ -46,6 +47,7 @@ import {
|
|
|
46
47
|
pluralToKind,
|
|
47
48
|
relatedResourcePath,
|
|
48
49
|
buildWorkloadPath,
|
|
50
|
+
namespacesFromSearch,
|
|
49
51
|
type NavigateToResource,
|
|
50
52
|
} from '../../utils/navigation'
|
|
51
53
|
import {
|
|
@@ -81,6 +83,7 @@ import {
|
|
|
81
83
|
useCordonNode,
|
|
82
84
|
useUncordonNode,
|
|
83
85
|
useDrainNode,
|
|
86
|
+
useNodeDrainActivity,
|
|
84
87
|
useDrainPlan,
|
|
85
88
|
useCascadeDeletePreview,
|
|
86
89
|
useResourceEvents,
|
|
@@ -98,7 +101,7 @@ import { WorkloadCostTab } from '../cost/WorkloadCostTab'
|
|
|
98
101
|
import { isOpenCostWorkloadKind } from '../cost/kinds'
|
|
99
102
|
import { isRadarFeatureUnsupported } from '../../api/radarFeatures'
|
|
100
103
|
import { useTrafficAvailable } from '../../api/traffic'
|
|
101
|
-
import { useResourceAudit, useResourceIssues, useTrace, fetchTraceWithProbes, fetchInClusterCapability, runInClusterMerged } from '../../api/client'
|
|
104
|
+
import { useResourceAudit, useResourceIssues, useSubjectIssues, useRadarFeature, useTrace, fetchTraceWithProbes, fetchInClusterCapability, runInClusterMerged } from '../../api/client'
|
|
102
105
|
import { AuditAlerts, getRadarUpgradeRequirement, ResourceIssuesSection, ReachabilityView, TraceSummary, InClusterConsentDialog, traceFingerprint, staticPollUnreliable, summarizeInClusterTests, type Trace as NetworkTrace, type InClusterCapability, inClusterConsentGiven, consentRequestRows } from '@skyhook-io/k8s-ui'
|
|
103
106
|
import { WorkloadLogsViewer } from '../logs/WorkloadLogsViewer'
|
|
104
107
|
import { ScheduledWorkloadLogsViewer } from '../logs/ScheduledWorkloadLogsViewer'
|
|
@@ -127,6 +130,7 @@ import { cleanYamlForDuplicate } from '../../utils/skeleton-yaml'
|
|
|
127
130
|
import { useDesktopDownload } from '../../hooks/useDesktopDownload'
|
|
128
131
|
import { useCompareLauncher } from '../compare/useCompareLauncher'
|
|
129
132
|
import { useDiagnoseCustomization } from '../../context/DiagnoseCustomization'
|
|
133
|
+
import { NodeDrainStatus } from './NodeDrainStatus'
|
|
130
134
|
|
|
131
135
|
type TabType = WorkloadTabType
|
|
132
136
|
const BATCH_EXECUTION_KINDS = new Set([
|
|
@@ -289,6 +293,7 @@ function useActionsBarProps(
|
|
|
289
293
|
name: string,
|
|
290
294
|
group: string | undefined,
|
|
291
295
|
cascadeEnabled: boolean,
|
|
296
|
+
nodeUID: string,
|
|
292
297
|
) {
|
|
293
298
|
const { showCopied } = useToast()
|
|
294
299
|
const { features } = useCapabilitiesContext()
|
|
@@ -367,7 +372,8 @@ function useActionsBarProps(
|
|
|
367
372
|
const canNodeWrite = useCanNodeWrite()
|
|
368
373
|
const cordonMutation = useCordonNode()
|
|
369
374
|
const uncordonMutation = useUncordonNode()
|
|
370
|
-
const drainMutation = useDrainNode()
|
|
375
|
+
const drainMutation = useDrainNode(nodeUID)
|
|
376
|
+
const { activity: drainActivity } = useNodeDrainActivity(name, nodeUID)
|
|
371
377
|
const drainPlanMutation = useDrainPlan()
|
|
372
378
|
|
|
373
379
|
const { renderAction: renderDiagnose } = useDiagnoseCustomization()
|
|
@@ -473,7 +479,7 @@ function useActionsBarProps(
|
|
|
473
479
|
isUncordoningNode: uncordonMutation.isPending,
|
|
474
480
|
onDrainNode: (params: Parameters<typeof drainMutation.mutate>[0]) =>
|
|
475
481
|
drainMutation.mutate(params),
|
|
476
|
-
isDrainingNode: drainMutation.isPending,
|
|
482
|
+
isDrainingNode: nodeUID ? drainActivity?.status === 'pending' : drainMutation.isPending,
|
|
477
483
|
onPlanDrain: (params: Parameters<typeof drainPlanMutation.mutate>[0]) =>
|
|
478
484
|
drainPlanMutation.mutate(params),
|
|
479
485
|
onPlanDrainReset: () => drainPlanMutation.reset(),
|
|
@@ -496,6 +502,8 @@ export function WorkloadView({
|
|
|
496
502
|
}: WorkloadViewProps) {
|
|
497
503
|
const [searchParams, setSearchParams] = useSearchParams()
|
|
498
504
|
const location = useLocation()
|
|
505
|
+
const viewNamespacesKey = namespacesFromSearch(searchParams).join(',')
|
|
506
|
+
const viewNamespaces = useMemo(() => (viewNamespacesKey ? viewNamespacesKey.split(',') : []), [viewNamespacesKey])
|
|
499
507
|
const apiKind = kindToPluralWithGroup(kindProp, rest.group ?? '')
|
|
500
508
|
const queryClient = useQueryClient()
|
|
501
509
|
const [imageTargetOwnership, setImageTargetOwnership] =
|
|
@@ -563,6 +571,8 @@ export function WorkloadView({
|
|
|
563
571
|
const batchRunsQuery = useWorkloadRuns(apiKind, namespace, name, expanded && batchExecution, {
|
|
564
572
|
refetchActive: true,
|
|
565
573
|
clusterScoped: batchKind === 'ClusterWorkflowTemplate',
|
|
574
|
+
namespaces: viewNamespaces,
|
|
575
|
+
ownerUID: batchKind === 'CronJob' ? resource?.metadata?.uid : undefined,
|
|
566
576
|
})
|
|
567
577
|
const relatedTimelineEvents = useMemo(
|
|
568
578
|
() => batchKind === 'JobSet' ? [] : workloadRunTimelineEvents(batchRunsQuery.data?.runs ?? []),
|
|
@@ -786,6 +796,7 @@ export function WorkloadView({
|
|
|
786
796
|
name,
|
|
787
797
|
effectiveGroup,
|
|
788
798
|
!resourceLoading && Boolean(resource),
|
|
799
|
+
apiKind === 'nodes' && !effectiveGroup ? resource?.metadata?.uid ?? '' : '',
|
|
789
800
|
)
|
|
790
801
|
const desktopDownload = useDesktopDownload()
|
|
791
802
|
|
|
@@ -797,7 +808,19 @@ export function WorkloadView({
|
|
|
797
808
|
// would flip the query key when the manifest arrives, drop liveIssues, and flash
|
|
798
809
|
// the renderer banners. The backend canonicalizes a plural kind via discovery,
|
|
799
810
|
// so using the normalized API kind resolves direct links and app navigation alike.
|
|
800
|
-
const
|
|
811
|
+
const isCronJob = apiKind === 'cronjobs' && (!effectiveGroup || effectiveGroup === 'batch')
|
|
812
|
+
const { support: coverageSupport } = useRadarFeature('resourceIssueCoverage')
|
|
813
|
+
const useCronJobCoverage = isCronJob && coverageSupport === 'supported'
|
|
814
|
+
const ordinaryIssues = useResourceIssues(apiKind, rest.group, namespace, name, !useCronJobCoverage)
|
|
815
|
+
const cronJobIssues = useSubjectIssues(useCronJobCoverage ? { kind: 'CronJob', group: 'batch', namespace, name, uid: resource?.metadata?.uid } : null, useCronJobCoverage && Boolean(resource))
|
|
816
|
+
const liveIssues = useCronJobCoverage ? cronJobIssues.data?.issues : ordinaryIssues.data
|
|
817
|
+
const issuesPending = useCronJobCoverage ? cronJobIssues.isPending : ordinaryIssues.isPending
|
|
818
|
+
const schedulingEvidence = cronJobIssues.data?.scheduling_report?.uid === resource?.metadata?.uid ? cronJobIssues.data?.scheduling_report : undefined
|
|
819
|
+
const [schedulingTimelineFocus, setSchedulingTimelineFocus] = useState<{ uid: string; id: string }>()
|
|
820
|
+
const viewSchedulingReport = useCallback(() => {
|
|
821
|
+
setSchedulingTimelineFocus(schedulingEvidence?.event_id ? { uid: schedulingEvidence.uid, id: schedulingEvidence.event_id } : undefined)
|
|
822
|
+
handleTabChange('timeline')
|
|
823
|
+
}, [schedulingEvidence, handleTabChange])
|
|
801
824
|
const { data: auditFindings } = useResourceAudit(apiKind, namespace, name, effectiveGroup)
|
|
802
825
|
const hasOperationalIssues = Boolean(liveIssues?.length)
|
|
803
826
|
const {
|
|
@@ -1144,6 +1167,7 @@ export function WorkloadView({
|
|
|
1144
1167
|
refetch={refetchResourceAndRuns}
|
|
1145
1168
|
// Timeline
|
|
1146
1169
|
allEvents={allEvents}
|
|
1170
|
+
timelineFocusEvent={schedulingTimelineFocus?.uid === resource?.metadata?.uid ? schedulingTimelineFocus : undefined}
|
|
1147
1171
|
historyTruncated={!historyFallback && historyTruncated}
|
|
1148
1172
|
onLoadOlderHistory={historyFallback ? undefined : loadOlderHistory}
|
|
1149
1173
|
loadingOlderHistory={!historyFallback && loadingOlderHistory}
|
|
@@ -1180,10 +1204,11 @@ export function WorkloadView({
|
|
|
1180
1204
|
group={effectiveGroup}
|
|
1181
1205
|
selectedRunKey={selectedRunKey}
|
|
1182
1206
|
onSelectRun={handleSelectedRunChange}
|
|
1207
|
+
viewNamespaces={viewNamespaces}
|
|
1183
1208
|
/>
|
|
1184
1209
|
)}
|
|
1185
1210
|
{...resourceDetailSlots({ kind: apiKind, group: resource?.apiVersion ? resourceGroup : effectiveGroup, namespace, name }, rest.extraTabs)}
|
|
1186
|
-
renderExpandedOverview={({ kind: k, apiKind, namespace: ns, name: n, resource: res }) =>
|
|
1211
|
+
renderExpandedOverview={({ kind: k, apiKind, namespace: ns, name: n, resource: res, leadContent }) =>
|
|
1187
1212
|
supportsBatchExecution(k, apiKind, effectiveGroup, res?.apiVersion) &&
|
|
1188
1213
|
res ? (
|
|
1189
1214
|
<BatchExecutionFullscreen
|
|
@@ -1193,11 +1218,13 @@ export function WorkloadView({
|
|
|
1193
1218
|
name={n}
|
|
1194
1219
|
resource={res}
|
|
1195
1220
|
selectedRunKey={selectedRunKey}
|
|
1221
|
+
leadContent={leadContent}
|
|
1196
1222
|
canViewLogs={baseActionsBarProps.canViewLogs}
|
|
1197
1223
|
onSelectRun={handleSelectedRunChange}
|
|
1198
1224
|
onSwitchToLogs={() => handleTabChange('logs')}
|
|
1199
1225
|
onSwitchToTimeline={() => handleTabChange('timeline')}
|
|
1200
1226
|
onNavigateToResource={rest.onNavigateToResource}
|
|
1227
|
+
viewNamespaces={viewNamespaces}
|
|
1201
1228
|
/>
|
|
1202
1229
|
) : null
|
|
1203
1230
|
}
|
|
@@ -1248,6 +1275,9 @@ export function WorkloadView({
|
|
|
1248
1275
|
onDownload={desktopDownload}
|
|
1249
1276
|
actionsBarProps={actionsBarProps}
|
|
1250
1277
|
rendererOverrides={resourceRendererOverrides}
|
|
1278
|
+
renderOverviewIntro={apiKind === 'nodes' && !effectiveGroup && resource?.metadata?.uid
|
|
1279
|
+
? () => <NodeDrainStatus name={name} nodeUID={resource.metadata.uid} />
|
|
1280
|
+
: undefined}
|
|
1251
1281
|
renderOverviewExtra={({ kind: k, namespace: ns, name: n, group: g, context }) => {
|
|
1252
1282
|
// Network entry kinds (Service/Ingress/Route/Gateway) ARE the diagnosis
|
|
1253
1283
|
// target: DiagnoseInlineSection renders in the drawer, no hint. Workload
|
|
@@ -1273,8 +1303,11 @@ export function WorkloadView({
|
|
|
1273
1303
|
)
|
|
1274
1304
|
}}
|
|
1275
1305
|
renderOverviewLead={() => (
|
|
1306
|
+
<div className="flex flex-col gap-4">
|
|
1307
|
+
<CronJobSchedulingContext evidence={schedulingEvidence} onViewTimeline={viewSchedulingReport} />
|
|
1276
1308
|
<ResourceIssuesSection
|
|
1277
1309
|
issues={liveIssues}
|
|
1310
|
+
renderDetailSection={schedulingEvidence?.state === 'reported' ? ({ issue }) => issue.kind === 'CronJob' && issue.reason === schedulingEvidence.reason ? <CronJobSchedulingDetails evidence={schedulingEvidence} onViewTimeline={viewSchedulingReport} /> : null : undefined}
|
|
1278
1311
|
compact={!expanded}
|
|
1279
1312
|
subjectResource={{ kind: apiKind, namespace, name, group: rest.group }}
|
|
1280
1313
|
onResourceClick={
|
|
@@ -1289,7 +1322,9 @@ export function WorkloadView({
|
|
|
1289
1322
|
: undefined
|
|
1290
1323
|
}
|
|
1291
1324
|
/>
|
|
1325
|
+
</div>
|
|
1292
1326
|
)}
|
|
1327
|
+
hasOverviewLead={hasOperationalIssues || Boolean(schedulingEvidence && schedulingEvidence.state !== 'reported')}
|
|
1293
1328
|
hasOperationalIssues={hasOperationalIssues}
|
|
1294
1329
|
operationalIssuesPending={issuesPending}
|
|
1295
1330
|
onOpenGitOpsResource={gitopsOwnerObject ? handleOpenGitOpsResource : undefined}
|
|
@@ -1442,6 +1477,7 @@ function LogsTabContent({
|
|
|
1442
1477
|
onConsumeInitialContainer,
|
|
1443
1478
|
selectedRunKey,
|
|
1444
1479
|
onSelectRun,
|
|
1480
|
+
viewNamespaces,
|
|
1445
1481
|
}: {
|
|
1446
1482
|
kind: string
|
|
1447
1483
|
apiKind: string
|
|
@@ -1456,6 +1492,7 @@ function LogsTabContent({
|
|
|
1456
1492
|
onConsumeInitialContainer: () => void
|
|
1457
1493
|
selectedRunKey: string
|
|
1458
1494
|
onSelectRun: (runKey: string) => void
|
|
1495
|
+
viewNamespaces: string[]
|
|
1459
1496
|
}) {
|
|
1460
1497
|
if (SCHEDULED_LOG_KINDS.has(kind) && supportsBatchExecution(kind, apiKind, group, resource?.apiVersion)) {
|
|
1461
1498
|
return (
|
|
@@ -1466,6 +1503,7 @@ function LogsTabContent({
|
|
|
1466
1503
|
name={name}
|
|
1467
1504
|
selectedRunKey={selectedRunKey}
|
|
1468
1505
|
onSelectRun={onSelectRun}
|
|
1506
|
+
viewNamespaces={viewNamespaces}
|
|
1469
1507
|
/>
|
|
1470
1508
|
</div>
|
|
1471
1509
|
)
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { QueryClient } from '@tanstack/react-query'
|
|
2
3
|
|
|
3
|
-
import { shouldApplyPolledConnection, shouldAutoRetryConnection } from './ConnectionContext'
|
|
4
|
+
import { shouldApplyPolledConnection, shouldAutoRetryConnection, refreshQueriesAfterReconnect } from './ConnectionContext'
|
|
5
|
+
|
|
6
|
+
it('retains local drain activity during same-context reconnects, but clears it for another context', () => {
|
|
7
|
+
const client = new QueryClient()
|
|
8
|
+
const drainKey = ['node-drain-activity', '/api', 'worker', 'node-uid']
|
|
9
|
+
client.setQueryData(drainKey, { status: 'pending' })
|
|
10
|
+
client.setQueryData(['resources', 'nodes'], ['stale-node'])
|
|
11
|
+
refreshQueriesAfterReconnect(client, 'original', 'original')
|
|
12
|
+
expect(client.getQueryData(drainKey)).toEqual({ status: 'pending' })
|
|
13
|
+
expect(client.getQueryData(['resources', 'nodes'])).toBeUndefined()
|
|
14
|
+
refreshQueriesAfterReconnect(client, 'original', 'other')
|
|
15
|
+
expect(client.getQueryData(drainKey)).toBeUndefined()
|
|
16
|
+
client.clear()
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('uses the recorded context when SSE has already updated the connection state', () => {
|
|
20
|
+
const client = new QueryClient()
|
|
21
|
+
const drainKey = ['node-drain-activity', '/api', 'worker', 'node-uid']
|
|
22
|
+
client.setQueryData(drainKey, { status: 'pending', contextName: 'original' })
|
|
23
|
+
refreshQueriesAfterReconnect(client, 'other', 'other')
|
|
24
|
+
expect(client.getQueryData(drainKey)).toBeUndefined()
|
|
25
|
+
client.setQueryData(drainKey, { status: 'pending', contextName: 'same' })
|
|
26
|
+
refreshQueriesAfterReconnect(client, '', 'same')
|
|
27
|
+
expect(client.getQueryData(drainKey)).toMatchObject({ status: 'pending' })
|
|
28
|
+
client.clear()
|
|
29
|
+
})
|
|
4
30
|
|
|
5
31
|
describe('shouldAutoRetryConnection', () => {
|
|
6
32
|
it('retries transient failures', () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createContext, useContext, useState, useCallback, useEffect, useRef, ReactNode } from 'react'
|
|
2
|
-
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
|
2
|
+
import { useQuery, useMutation, useQueryClient, type QueryClient } from '@tanstack/react-query'
|
|
3
3
|
import { getApiBase } from '../api/config'
|
|
4
4
|
import { readErrorBody } from '../api/httpErrors'
|
|
5
|
-
import { apiFetch, type SyncStatusSnapshot } from '../api/client'
|
|
5
|
+
import { apiFetch, type SyncStatusSnapshot, type NodeDrainActivity } from '../api/client'
|
|
6
6
|
|
|
7
7
|
export type ConnectionStateType = 'connected' | 'disconnected' | 'connecting'
|
|
8
8
|
|
|
@@ -51,6 +51,17 @@ const AUTO_RETRY_INITIAL_DELAY_MS = 10000
|
|
|
51
51
|
const AUTO_RETRY_MAX_DELAY_MS = 60000
|
|
52
52
|
const CONNECTION_STATUS_FALLBACK_POLL_MS = 30000
|
|
53
53
|
|
|
54
|
+
export function refreshQueriesAfterReconnect(queryClient: QueryClient, previousContext: string, nextContext: string) {
|
|
55
|
+
queryClient.removeQueries({
|
|
56
|
+
predicate: query => {
|
|
57
|
+
if (query.queryKey[0] !== 'node-drain-activity') return true
|
|
58
|
+
const activity = queryClient.getQueryData<NodeDrainActivity | null>(query.queryKey)
|
|
59
|
+
return activity?.contextName ? activity.contextName !== nextContext : previousContext !== nextContext
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
queryClient.invalidateQueries()
|
|
63
|
+
}
|
|
64
|
+
|
|
54
65
|
export function shouldAutoRetryConnection(errorType?: string): boolean {
|
|
55
66
|
// Auth-shaped failures are excluded: the server runs its own backoff
|
|
56
67
|
// reconnect loop for those, and each browser retry would invoke the exec
|
|
@@ -274,6 +285,7 @@ export function ConnectionProvider({ children }: { children: ReactNode }) {
|
|
|
274
285
|
}))
|
|
275
286
|
},
|
|
276
287
|
onSuccess: (result) => {
|
|
288
|
+
const previousContext = connectionRef.current.context
|
|
277
289
|
setConnection(result)
|
|
278
290
|
if (result.state === 'connected') {
|
|
279
291
|
// Keep the first-connect bookkeeping and the double-refresh window
|
|
@@ -281,9 +293,7 @@ export function ConnectionProvider({ children }: { children: ReactNode }) {
|
|
|
281
293
|
hasConnectedRef.current = true
|
|
282
294
|
lastCacheRefreshAtRef.current = Date.now()
|
|
283
295
|
}
|
|
284
|
-
|
|
285
|
-
queryClient.removeQueries()
|
|
286
|
-
queryClient.invalidateQueries()
|
|
296
|
+
refreshQueriesAfterReconnect(queryClient, previousContext, result.context)
|
|
287
297
|
},
|
|
288
298
|
onError: (error: Error) => {
|
|
289
299
|
const retryError = error as ConnectionRetryError
|
|
@@ -342,13 +352,13 @@ export function ConnectionProvider({ children }: { children: ReactNode }) {
|
|
|
342
352
|
recovered = true
|
|
343
353
|
autoRetryDelayRef.current = AUTO_RETRY_INITIAL_DELAY_MS
|
|
344
354
|
sseActiveRef.current = false
|
|
355
|
+
const previousContext = connectionRef.current.context
|
|
345
356
|
setConnection(result)
|
|
346
357
|
if (result.state === 'connected') {
|
|
347
358
|
hasConnectedRef.current = true
|
|
348
359
|
lastCacheRefreshAtRef.current = Date.now()
|
|
349
360
|
}
|
|
350
|
-
queryClient.
|
|
351
|
-
queryClient.invalidateQueries()
|
|
361
|
+
refreshQueriesAfterReconnect(queryClient, previousContext, result.context)
|
|
352
362
|
})
|
|
353
363
|
.catch((error: Error) => {
|
|
354
364
|
if (stopped) return
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { ResourceCoverage } from '@skyhook-io/k8s-ui'
|
|
1
2
|
import { useQuery } from '@tanstack/react-query'
|
|
2
3
|
import { debugNamespaceLog, fetchJSON, isStillLoadingError } from '../api/client'
|
|
3
4
|
import { useConnection } from '../context/ConnectionContext'
|
|
4
5
|
|
|
5
6
|
export interface ResourceCountsResponse {
|
|
6
7
|
counts: Record<string, number>
|
|
8
|
+
coverage?: Record<string, ResourceCoverage>
|
|
7
9
|
forbidden?: string[]
|
|
8
10
|
reasons?: Record<string, string>
|
|
9
11
|
unavailable?: string[]
|
package/src/index.css
CHANGED
|
@@ -53,10 +53,8 @@
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/*
|
|
56
|
-
* Tailwind v4 theme tokens
|
|
57
|
-
*
|
|
58
|
-
* to pick up radar's Node config or its `@tailwindcss/typography` plugin
|
|
59
|
-
* when they consume this package from npm.
|
|
56
|
+
* Tailwind v4 theme tokens live in CSS so library consumers (e.g.
|
|
57
|
+
* radar-hub-web) get the same theme when they import this package's styles.
|
|
60
58
|
*/
|
|
61
59
|
@theme {
|
|
62
60
|
--color-investigation-assessment: light-dark(#edf3fc, #182237);
|
package/src/index.ts
CHANGED
|
@@ -96,7 +96,14 @@ export type {
|
|
|
96
96
|
OmnibarHandle,
|
|
97
97
|
OmnibarRecent,
|
|
98
98
|
OmnibarSearchResult,
|
|
99
|
+
OmnibarNote,
|
|
100
|
+
OmnibarNotePart,
|
|
99
101
|
} from './components/ui/Omnibar';
|
|
100
102
|
export { bestScore } from './components/ui/command-items';
|
|
101
103
|
export type { CommandItem } from './components/ui/command-items';
|
|
102
104
|
export type { SearchHit, SearchMatchedField } from './api/client';
|
|
105
|
+
|
|
106
|
+
export { fetchResourceList, type ResourceListOptions } from './api/client';
|
|
107
|
+
export { normalizeResourceList, type ResourceListBody, type ResourceListResult } from './api/resourceLists';
|
|
108
|
+
export type { ResourceCoverage, ResourceReadCoverage, ResourceListResponse } from '@skyhook-io/k8s-ui';
|
|
109
|
+
export type { SearchCoverageEntry } from './components/ui/searchCoverageNote';
|
|
@@ -55,6 +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',
|
|
58
59
|
].sort())
|
|
59
60
|
const inherited = [{ id: 'local', label: 'Local', render: () => null }]
|
|
60
61
|
expect(resourceDetailSlots({ kind: 'Pod', group: '', namespace: 'db', name: 'pg-1' }, inherited).extraTabs).toEqual(inherited)
|
|
@@ -35,6 +35,7 @@ import { KyvernoPolicyQueued } from '../components/resources/renderers/KyvernoPo
|
|
|
35
35
|
import { VeleroBSLRenderer } from '../components/resources/renderers/VeleroBSLRenderer'
|
|
36
36
|
import { VeleroBackupRenderer } from '../components/resources/renderers/VeleroBackupRenderer'
|
|
37
37
|
import { VeleroRestoreRenderer } from '../components/resources/renderers/VeleroRestoreRenderer'
|
|
38
|
+
import { FluxHelmReleaseRenderer } from '../components/resources/renderers/FluxHelmReleaseRenderer'
|
|
38
39
|
|
|
39
40
|
export const resourceHosts: readonly ResourceHost[] = [
|
|
40
41
|
{ id: 'kubernetes', renderers: { PodRenderer, NodeRenderer, ServiceRenderer, WorkloadRenderer, HPARenderer, PVCRenderer } },
|
|
@@ -47,6 +48,7 @@ export const resourceHosts: readonly ResourceHost[] = [
|
|
|
47
48
|
{ id: 'rollouts', renderers: { RolloutRenderer } },
|
|
48
49
|
{ id: 'kyverno', renderers: { KyvernoPolicyCoverage, KyvernoPolicyQueued } },
|
|
49
50
|
{ id: 'velero', renderers: { VeleroBSLRenderer, VeleroBackupRenderer, VeleroRestoreRenderer } },
|
|
51
|
+
{ id: 'flux', renderers: { FluxHelmReleaseRenderer } },
|
|
50
52
|
cnpgResourceHost,
|
|
51
53
|
]
|
|
52
54
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { artifactHubPublisher, isArtifactHubOfficial } from './artifacthub'
|
|
3
|
+
|
|
4
|
+
describe('ArtifactHub display metadata', () => {
|
|
5
|
+
const repository = { name: 'repository', url: 'https://charts.example.test' }
|
|
6
|
+
it('prefers the publisher display name and supports older responses', () => {
|
|
7
|
+
expect(artifactHubPublisher({ ...repository, organizationDisplayName: 'Publisher Team', organizationName: 'publisher', userAlias: 'account' })).toBe('Publisher Team')
|
|
8
|
+
expect(artifactHubPublisher({ ...repository, organizationName: 'publisher', userAlias: 'account' })).toBe('publisher')
|
|
9
|
+
expect(artifactHubPublisher({ ...repository, userAlias: 'account' })).toBe('account')
|
|
10
|
+
expect(artifactHubPublisher(repository)).toBe('repository')
|
|
11
|
+
})
|
|
12
|
+
it('recognizes either official scope without treating verified as official', () => {
|
|
13
|
+
const chart = { packageId: 'id', name: 'chart', version: '1.0.0', stars: 0, repository }
|
|
14
|
+
expect(isArtifactHubOfficial({ ...chart, official: true })).toBe(true)
|
|
15
|
+
expect(isArtifactHubOfficial({ ...chart, repository: { ...repository, official: true } })).toBe(true)
|
|
16
|
+
expect(isArtifactHubOfficial({ ...chart, repository: { ...repository, verifiedPublisher: true } })).toBe(false)
|
|
17
|
+
})
|
|
18
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ArtifactHubChart, ArtifactHubRepository } from '../types'
|
|
2
|
+
|
|
3
|
+
export function artifactHubPublisher(repository: ArtifactHubRepository): string {
|
|
4
|
+
return repository.organizationDisplayName || repository.organizationName || repository.userAlias || repository.name
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function isArtifactHubOfficial(chart: ArtifactHubChart): boolean {
|
|
8
|
+
return Boolean(chart.official || chart.repository.official)
|
|
9
|
+
}
|
package/src/utils/navigation.ts
CHANGED
|
@@ -134,6 +134,20 @@ export function openExternal(url: string): void {
|
|
|
134
134
|
})
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
/** The header picker's namespace selection as the URL carries it: App keeps
|
|
138
|
+
* ?namespaces= in sync with its state (legacy ?namespace= still read). */
|
|
139
|
+
export function namespacesFromSearch(params: URLSearchParams): string[] {
|
|
140
|
+
const nsParam = params.get('namespaces')
|
|
141
|
+
if (nsParam) {
|
|
142
|
+
return nsParam.split(',').map(s => s.trim()).filter(Boolean)
|
|
143
|
+
}
|
|
144
|
+
const ns = params.get('namespace')
|
|
145
|
+
if (ns) {
|
|
146
|
+
return [ns]
|
|
147
|
+
}
|
|
148
|
+
return []
|
|
149
|
+
}
|
|
150
|
+
|
|
137
151
|
// setMainView's cross-view params. A navigation whose search omits
|
|
138
152
|
// ?namespaces= reads as an empty pick to App's URL sync, which clears the
|
|
139
153
|
// user's namespace scope.
|
|
@@ -10,8 +10,10 @@
|
|
|
10
10
|
// these accelerators with nil callbacks (native responder chain), but WKWebView
|
|
11
11
|
// does NOT dispatch a DOM copy/cut event from the native copy: selector.
|
|
12
12
|
// The keydown event DOES reach JS, so we intercept it here.
|
|
13
|
-
// Cmd+V: Handled by menu.go's explicit WindowExecJS callback which reads
|
|
14
|
-
//
|
|
13
|
+
// Cmd+V: Handled by menu.go's explicit WindowExecJS callback, which reads
|
|
14
|
+
// through Wails on macOS. Focused Monaco editors receive a text paste command
|
|
15
|
+
// to avoid their rich paste handler reading the clipboard again. Other
|
|
16
|
+
// inputs receive a synthetic paste event.
|
|
15
17
|
// Right-click Copy/Cut (Monaco): Monaco calls document.execCommand('copy'/'cut'),
|
|
16
18
|
// intercepted by the monkey-patch below.
|
|
17
19
|
// Right-click Paste (Monaco): Not supported — Monaco calls navigator.clipboard
|