@skyhook-io/radar-app 1.21.1 → 1.21.3
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 +11 -0
- package/package.json +2 -2
- package/src/App.tsx +50 -28
- package/src/api/actions.test.ts +11 -0
- package/src/api/actions.ts +5 -0
- package/src/api/apiResources.navigation.test.tsx +58 -0
- package/src/api/apiResources.ts +22 -16
- package/src/api/client.diagnostics.test.ts +52 -0
- package/src/api/client.triggerCronJob.test.tsx +49 -0
- package/src/api/client.ts +140 -120
- package/src/api/connectionBinding.test.tsx +82 -0
- package/src/api/connectionBinding.ts +52 -0
- package/src/api/contextSwitch.test.ts +11 -0
- package/src/api/contextSwitch.ts +58 -0
- package/src/api/radarFeatures.ts +7 -0
- package/src/api/sealedSecrets.test.ts +22 -0
- package/src/api/sealedSecrets.ts +37 -0
- package/src/api/vulnerabilities.ts +80 -7
- package/src/components/ConnectionErrorView.tsx +13 -0
- package/src/components/ContextSwitchActions.tsx +43 -0
- package/src/components/ContextSwitcher.tsx +13 -6
- package/src/components/SwitchAwareConnectionError.tsx +2 -2
- package/src/components/audit/Java4ShellPanel.test.tsx +104 -7
- package/src/components/audit/Java4ShellPanel.tsx +169 -72
- package/src/components/cost/ApplicationCostTab.test.ts +16 -0
- package/src/components/cost/ApplicationCostTab.tsx +41 -9
- package/src/components/cost/CostTrendChart.tsx +25 -2
- package/src/components/cost/CostTrendWithheld.render.test.tsx +105 -0
- package/src/components/cost/CostView.tsx +10 -2
- package/src/components/cost/CostViewTabs.test.tsx +18 -0
- package/src/components/cost/CostViewTabs.tsx +14 -22
- package/src/components/cost/WorkloadCostTab.test.ts +15 -0
- package/src/components/cost/WorkloadCostTab.tsx +42 -8
- package/src/components/cost/source.test.ts +16 -1
- package/src/components/cost/source.ts +34 -0
- package/src/components/diagnose/investigationEvidence/adapters/diagnose.test.ts +35 -0
- package/src/components/diagnose/investigationEvidence/adapters/diagnose.ts +16 -1
- package/src/components/dock/NodeTerminalTab.test.tsx +4 -2
- package/src/components/dock/NodeTerminalTab.tsx +8 -8
- package/src/components/dock/TerminalTab.test.tsx +12 -1
- package/src/components/dock/TerminalTab.tsx +6 -3
- package/src/components/home/CostCard.test.tsx +49 -0
- package/src/components/home/CostCard.tsx +98 -63
- package/src/components/home/mcpToolCatalog.ts +1 -0
- package/src/components/resource/DatadogRightsizingPanel.test.tsx +118 -0
- package/src/components/resource/DatadogRightsizingPanel.tsx +68 -0
- package/src/components/resource/DatadogWorkloadCharts.tsx +149 -0
- package/src/components/resource/HPACharts.render.test.tsx +42 -0
- package/src/components/resource/HPACharts.tsx +34 -1
- package/src/components/resource/PrometheusChartsGrid.render.test.tsx +126 -3
- package/src/components/resource/PrometheusChartsGrid.tsx +58 -25
- package/src/components/resource/RestartChart.render.test.tsx +72 -0
- package/src/components/resource/RestartChart.tsx +31 -3
- package/src/components/resource/RightsizingPanel.access.test.tsx +24 -0
- package/src/components/resource/RightsizingStrip.render.test.tsx +44 -0
- package/src/components/resource/RightsizingStrip.test.ts +1 -188
- package/src/components/resource/RightsizingStrip.tsx +27 -300
- package/src/components/resource/WorkloadMetricsSection.render.test.tsx +22 -0
- package/src/components/resource/WorkloadMetricsSection.tsx +14 -4
- package/src/components/resource/nameMatchedScope.ts +39 -0
- package/src/components/resources/pod-file-upload.ts +3 -0
- package/src/components/resources/renderers/CAPIClusterRenderer.tsx +5 -2
- package/src/components/resources/renderers/LonghornVolumeRenderer.test.tsx +104 -0
- package/src/components/resources/renderers/LonghornVolumeRenderer.tsx +31 -0
- package/src/components/resources/renderers/SealedSecretRenderer.test.tsx +41 -0
- package/src/components/resources/renderers/SealedSecretRenderer.tsx +14 -0
- package/src/components/rightsizing/RightsizingScanLink.tsx +22 -0
- package/src/components/rightsizing/RightsizingScanView.tsx +65 -528
- package/src/components/rightsizing/model.test.ts +20 -9
- package/src/components/rightsizing/model.ts +17 -176
- package/src/components/rightsizing/notices.test.tsx +30 -29
- package/src/components/traffic/TrafficFlowList.tsx +8 -4
- package/src/components/traffic/TrafficGraph.test.tsx +31 -1
- package/src/components/traffic/TrafficGraph.tsx +11 -6
- package/src/components/traffic/trafficFilters.ts +4 -4
- package/src/components/ui/DiagnosticsOverlay.test.ts +3 -2
- package/src/components/ui/DiagnosticsOverlay.tsx +23 -13
- package/src/components/ui/command-items.ts +3 -4
- package/src/components/useContextSwitchFlow.test.tsx +9 -0
- package/src/components/useContextSwitchFlow.tsx +43 -5
- package/src/components/vulnerabilities/WorkloadVulnerabilitiesSection.test.tsx +54 -0
- package/src/components/vulnerabilities/WorkloadVulnerabilitiesSection.tsx +50 -109
- package/src/components/whats-new/releaseNotes.ts +1 -1
- package/src/components/workload/WorkloadRightsizingSource.test.tsx +83 -0
- package/src/components/workload/WorkloadView.test.ts +22 -1
- package/src/components/workload/WorkloadView.tsx +57 -16
- package/src/context/ConnectionContext.test.ts +1 -0
- package/src/context/ConnectionContext.tsx +58 -15
- package/src/context/ConnectionProvider.connectionId.test.tsx +92 -0
- package/src/context/ConnectionProvider.retry.test.tsx +174 -1
- package/src/context/ContextSwitchContext.tsx +15 -1
- package/src/context/NavCustomization.tsx +6 -3
- package/src/hooks/useEventSource.test.tsx +85 -0
- package/src/hooks/useEventSource.ts +43 -16
- package/src/hooks/useResetViewsOnContextChange.test.tsx +34 -0
- package/src/hooks/useResetViewsOnContextChange.ts +27 -0
- package/src/index.ts +3 -0
- package/src/integrations/resourceHosts.test.tsx +2 -2
- package/src/integrations/resourceHosts.tsx +4 -0
- package/src/utils/navigation.ts +1 -15
- package/src/utils/page-links.ts +6 -0
- package/src/components/rightsizing/presentation.test.ts +0 -150
- package/src/components/rightsizing/presentation.ts +0 -109
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { useState, type ReactNode } from 'react'
|
|
1
|
+
import { useLayoutEffect, useState, type ReactNode } from 'react'
|
|
2
2
|
import { AlertTriangle } from 'lucide-react'
|
|
3
3
|
import { pluralize } from '@skyhook-io/k8s-ui'
|
|
4
4
|
import { useSwitchContext, fetchSessionCounts, SwitchContextError, type SessionCounts } from '../api/client'
|
|
5
|
+
import { finishSwitch, followSwitch, followingSwitch, switchInProgress, useTrackedContextSwitch } from '../api/contextSwitch'
|
|
6
|
+
import { useConnection } from '../context/ConnectionContext'
|
|
5
7
|
import { useContextSwitch } from '../context/ContextSwitchContext'
|
|
6
8
|
import { useToast } from './ui/Toast'
|
|
7
9
|
import { Tooltip } from './ui/Tooltip'
|
|
@@ -30,8 +32,9 @@ interface PendingSwitch {
|
|
|
30
32
|
// toast when the switch fails. `openAfter` is opened once the new context is
|
|
31
33
|
// live. Callers render `confirmDialog`.
|
|
32
34
|
export function useContextSwitchFlow() {
|
|
35
|
+
const { connection } = useConnection()
|
|
33
36
|
const switchContext = useSwitchContext()
|
|
34
|
-
const { startSwitch, endSwitch, setOpenAfterSwitch, setFailedSwitch } = useContextSwitch()
|
|
37
|
+
const { isSwitching, startSwitch, endSwitch, setOpenAfterSwitch, setFailedSwitch } = useContextSwitch()
|
|
35
38
|
const { showError } = useToast()
|
|
36
39
|
const { tabs } = useDock()
|
|
37
40
|
const [pending, setPending] = useState<PendingSwitch | null>(null)
|
|
@@ -65,9 +68,9 @@ export function useContextSwitchFlow() {
|
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
const requestSwitch = async (context: ContextInfo, openAfter?: SelectedResource) => {
|
|
68
|
-
if (switchContext.isPending) return
|
|
71
|
+
if (isSwitching || switchContext.isPending) return
|
|
69
72
|
// Picking the cluster you're still on dismisses a refused switch's screen.
|
|
70
|
-
if (context.isCurrent) {
|
|
73
|
+
if (context.isCurrent && connection.errorType !== 'switch-stopped') {
|
|
71
74
|
setFailedSwitch(null)
|
|
72
75
|
return
|
|
73
76
|
}
|
|
@@ -157,7 +160,7 @@ export function useContextSwitchFlow() {
|
|
|
157
160
|
|
|
158
161
|
return {
|
|
159
162
|
requestSwitch,
|
|
160
|
-
isPending: switchContext.isPending,
|
|
163
|
+
isPending: !!isSwitching || switchContext.isPending,
|
|
161
164
|
error: switchContext.isError ? switchContext.error : null,
|
|
162
165
|
// The picker's inline line is for failures that don't get the full screen.
|
|
163
166
|
errorText: switchContext.isError && switchContext.error && !refusedBeforeLeaving(switchContext.error)
|
|
@@ -170,3 +173,38 @@ export function useContextSwitchFlow() {
|
|
|
170
173
|
function shortNameHides(context: ContextInfo) {
|
|
171
174
|
return parseContextForSwitcher(context).clusterName !== context.name
|
|
172
175
|
}
|
|
176
|
+
|
|
177
|
+
export function useContextSwitchOutcome(applyContextChange: (context: string, id: string) => void) {
|
|
178
|
+
const { contextSwitch: polledSwitch, connection } = useConnection()
|
|
179
|
+
const contextSwitch = useTrackedContextSwitch(polledSwitch)
|
|
180
|
+
const { endSwitch, setOpenAfterSwitch, setFailedSwitch } = useContextSwitch()
|
|
181
|
+
const { showError } = useToast()
|
|
182
|
+
|
|
183
|
+
useLayoutEffect(() => {
|
|
184
|
+
if (!contextSwitch) return
|
|
185
|
+
if (switchInProgress(contextSwitch)) {
|
|
186
|
+
if (followingSwitch() !== contextSwitch.id) followSwitch(contextSwitch.id)
|
|
187
|
+
// The accepted POST can arrive before the first connection poll. Keep
|
|
188
|
+
// local progress until an observed operation takes over the overlay.
|
|
189
|
+
endSwitch()
|
|
190
|
+
return
|
|
191
|
+
}
|
|
192
|
+
if (followingSwitch() !== contextSwitch.id) return
|
|
193
|
+
if (contextSwitch.phase === 'failed' && connection.state === 'connecting') return
|
|
194
|
+
finishSwitch(contextSwitch.id)
|
|
195
|
+
endSwitch()
|
|
196
|
+
if (contextSwitch.phase === 'succeeded' && connection.context === contextSwitch.target) {
|
|
197
|
+
applyContextChange(contextSwitch.target, contextSwitch.id)
|
|
198
|
+
} else {
|
|
199
|
+
setOpenAfterSwitch(null)
|
|
200
|
+
if (contextSwitch.phase === 'failed' && (connection.state === 'connected' || connection.context !== contextSwitch.target)) {
|
|
201
|
+
const reason = contextSwitch.error || 'Cluster switch failed'
|
|
202
|
+
if (contextSwitch.errorType) {
|
|
203
|
+
setFailedSwitch({ context: contextSwitch.target, error: reason, errorType: contextSwitch.errorType })
|
|
204
|
+
} else {
|
|
205
|
+
showError('Failed to switch context', reason)
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}, [contextSwitch, connection.state, connection.context, applyContextChange, endSwitch, setOpenAfterSwitch, setFailedSwitch, showError])
|
|
210
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { renderToStaticMarkup } from 'react-dom/server'
|
|
2
|
+
import { MemoryRouter } from 'react-router-dom'
|
|
3
|
+
import { expect, it, vi } from 'vitest'
|
|
4
|
+
import { useAPIResources } from '../../api/apiResources'
|
|
5
|
+
import { useVulnerabilities, type VulnerableImage } from '../../api/vulnerabilities'
|
|
6
|
+
import { WorkloadVulnerabilitiesSection } from './WorkloadVulnerabilitiesSection'
|
|
7
|
+
|
|
8
|
+
vi.mock('../../api/apiResources', () => ({ useAPIResources: vi.fn() }))
|
|
9
|
+
vi.mock('../../api/client', () => ({ useRadarFeature: () => ({ support: 'supported' }) }))
|
|
10
|
+
vi.mock('../../api/vulnerabilities', async (importOriginal) => ({
|
|
11
|
+
...await importOriginal<typeof import('../../api/vulnerabilities')>(),
|
|
12
|
+
useVulnerabilities: vi.fn(),
|
|
13
|
+
}))
|
|
14
|
+
|
|
15
|
+
const workload = { kind: 'Deployment', group: 'apps', namespace: 'team', name: 'api', container: 'server' }
|
|
16
|
+
const zero = { critical: 0, high: 0, medium: 0, low: 0, unknown: 0 }
|
|
17
|
+
const image: VulnerableImage = {
|
|
18
|
+
id: 'api', image: 'example.com/team/api:1', scannedAt: '2026-11-20T12:00:00Z',
|
|
19
|
+
counts: { ...zero, critical: 1 }, fixable: { ...zero, critical: 1 }, matching: 1,
|
|
20
|
+
workloads: [workload], workloadsTotal: 1, findings: [], findingsTotal: 1,
|
|
21
|
+
report: { kind: 'VulnerabilityReport', namespace: 'team', name: 'deployment-api' },
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function renderDrawer(available: boolean, reports: { images: VulnerableImage[]; clean?: VulnerableImage[]; unscanned?: { image: string }[] }) {
|
|
25
|
+
vi.mocked(useAPIResources).mockReturnValue({
|
|
26
|
+
data: available ? [{ group: 'aquasecurity.github.io', name: 'vulnerabilityreports' }] : [],
|
|
27
|
+
} as ReturnType<typeof useAPIResources>)
|
|
28
|
+
vi.mocked(useVulnerabilities).mockImplementation(({ view }) => ({
|
|
29
|
+
data: view === 'image' ? reports : { fixes: [] },
|
|
30
|
+
} as ReturnType<typeof useVulnerabilities>))
|
|
31
|
+
return renderToStaticMarkup(
|
|
32
|
+
<MemoryRouter>
|
|
33
|
+
<WorkloadVulnerabilitiesSection kind={workload.kind} namespace={workload.namespace} name={workload.name} />
|
|
34
|
+
</MemoryRouter>,
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
it('omits the section when Trivy is unavailable or has no findings for the workload', () => {
|
|
39
|
+
expect(renderDrawer(false, { images: [] })).toBe('')
|
|
40
|
+
expect(renderDrawer(true, { images: [], clean: [{ ...image, counts: zero, findingsTotal: 0 }] })).toBe('')
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it('shows reported findings without an advisory scan action', () => {
|
|
44
|
+
const html = renderDrawer(true, { images: [image] })
|
|
45
|
+
expect(html).toContain('Vulnerabilities · 1 critical')
|
|
46
|
+
expect(html).toContain('1 with a fix')
|
|
47
|
+
expect(html).not.toContain('Java4Shell')
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it('discloses missing scans alongside reported findings', () => {
|
|
51
|
+
const html = renderDrawer(true, { images: [image], unscanned: [{ image: 'example.com/sidecar' }] })
|
|
52
|
+
expect(html).toContain('View unscanned images in this workload')
|
|
53
|
+
expect(html).not.toContain('Java4Shell')
|
|
54
|
+
})
|
|
@@ -6,11 +6,8 @@ import { Section } from '@skyhook-io/k8s-ui/components/ui/drawer-components'
|
|
|
6
6
|
import { formatRelativeAgeTime } from '@skyhook-io/k8s-ui/utils/format'
|
|
7
7
|
import { useAPIResources } from '../../api/apiResources'
|
|
8
8
|
import { useRadarFeature } from '../../api/client'
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { useConnection } from '../../context/ConnectionContext'
|
|
12
|
-
import { Java4ShellPanel } from '../audit/Java4ShellPanel'
|
|
13
|
-
import { ClearedCount, FixVersion, ImageName, SeverityCounts, gapSentence } from './parts'
|
|
9
|
+
import { hasVulnerabilityReports, useVulnerabilities, workloadParam } from '../../api/vulnerabilities'
|
|
10
|
+
import { ClearedCount, FixVersion, ImageName, SeverityCounts } from './parts'
|
|
14
11
|
|
|
15
12
|
interface Props {
|
|
16
13
|
kind: string
|
|
@@ -18,53 +15,20 @@ interface Props {
|
|
|
18
15
|
name: string
|
|
19
16
|
}
|
|
20
17
|
|
|
21
|
-
/**
|
|
22
|
-
* The drawer combines any available scanner reports with the on-demand advisory.
|
|
23
|
-
*/
|
|
24
18
|
export function WorkloadVulnerabilitiesSection({ kind, namespace, name }: Props) {
|
|
25
19
|
const navigate = useNavigate()
|
|
26
20
|
const [params] = useSearchParams()
|
|
27
21
|
const { data: resources } = useAPIResources()
|
|
28
22
|
const { support } = useRadarFeature('vulnerabilities')
|
|
29
|
-
const { support: advisorySupport } = useRadarFeature('runtimeAdvisoryChecks')
|
|
30
|
-
const { connection } = useConnection()
|
|
31
23
|
const available = hasVulnerabilityReports(resources) && support !== 'unsupported'
|
|
32
24
|
const workload = { kind, namespace, name }
|
|
33
|
-
const { data
|
|
34
|
-
// The upgrades it needs, as By fix works them out, once it has findings.
|
|
35
|
-
const { data: fixData } = useVulnerabilities({ view: 'fix', workload }, available && !!namespace && !!name && (data?.images ?? []).length > 0)
|
|
36
|
-
const advisory = advisorySupport === 'supported' && !!namespace && !!name && (
|
|
37
|
-
<Java4ShellPanel
|
|
38
|
-
context={connection.context}
|
|
39
|
-
connected={connection.state === 'connected'}
|
|
40
|
-
workload={{ ...workload, group: 'apps' }}
|
|
41
|
-
/>
|
|
42
|
-
)
|
|
43
|
-
if (!available || (error && (isRadarFeatureUnsupported(error) || isKindUnknown(error)))) {
|
|
44
|
-
return advisory ? <Section title="Vulnerabilities" icon={Shield}>{advisory}</Section> : null
|
|
45
|
-
}
|
|
46
|
-
if (error) {
|
|
47
|
-
return (
|
|
48
|
-
<Section title="Vulnerabilities" icon={Shield}>
|
|
49
|
-
<div className="flex flex-col gap-3">
|
|
50
|
-
<p className="text-xs text-warning-text">Couldn't read vulnerability reports: {error instanceof Error ? error.message : 'request failed'}.</p>
|
|
51
|
-
{advisory}
|
|
52
|
-
</div>
|
|
53
|
-
</Section>
|
|
54
|
-
)
|
|
55
|
-
}
|
|
56
|
-
|
|
25
|
+
const { data } = useVulnerabilities({ view: 'image', workload }, available && !!namespace && !!name)
|
|
57
26
|
const images = data?.images ?? []
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
27
|
+
const { data: fixData } = useVulnerabilities({ view: 'fix', workload }, available && !!namespace && !!name && images.length > 0)
|
|
28
|
+
if (!available || images.length === 0) return null
|
|
29
|
+
|
|
61
30
|
const critical = images.reduce((n, img) => n + (img.findingsUnread ? 0 : img.counts.critical), 0)
|
|
62
31
|
const upgrades = fixData?.fixes ?? []
|
|
63
|
-
// The read spans the caller's scope; a gap names this namespace, or might.
|
|
64
|
-
const relevantGaps = (data?.coverage.gaps ?? []).filter((g) => {
|
|
65
|
-
const ns = g.namespaces
|
|
66
|
-
return !ns || ns.extent !== undefined || (ns.names ?? []).length < ns.count || (ns.names ?? []).includes(namespace)
|
|
67
|
-
})
|
|
68
32
|
const isThis = (w: { kind: string; namespace: string; name: string }) => w.kind === kind && w.namespace === namespace && w.name === name
|
|
69
33
|
// The link keeps the page's namespace view, as every page link does: the
|
|
70
34
|
// picker follows the URL, so a narrower one would change it.
|
|
@@ -91,73 +55,50 @@ export function WorkloadVulnerabilitiesSection({ kind, namespace, name }: Props)
|
|
|
91
55
|
|
|
92
56
|
return (
|
|
93
57
|
<Section title={critical > 0 ? `Vulnerabilities · ${critical} critical` : 'Vulnerabilities'} icon={Shield}>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
</span>
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
<span className="col-span-2 font-medium text-theme-text-secondary">Upgrade first</span>
|
|
139
|
-
<span className="text-right text-theme-text-tertiary">C</span>
|
|
140
|
-
<span className="text-right text-theme-text-tertiary">H</span>
|
|
141
|
-
{upgrades.slice(0, UPGRADES_SHOWN).map((f) => (
|
|
142
|
-
<Fragment key={`${f.packageType ?? ''}/${f.package}/${f.to ?? (f.fixedVersions ?? []).join('|')}`}>
|
|
143
|
-
<span className="truncate font-mono text-theme-text-primary">{f.package}</span>
|
|
144
|
-
{f.to
|
|
145
|
-
? <span className="flex min-w-0 items-baseline gap-1 font-mono"><span className="text-theme-text-tertiary">→</span><FixVersion installed={f.from.join(', ')} target={f.to} showInstalled={false} /></span>
|
|
146
|
-
: <span className="truncate font-mono text-theme-text-tertiary">fixed in {(f.fixedVersions ?? []).join(', ')}</span>}
|
|
147
|
-
<ClearedCount count={f.counts.critical} severity="critical" />
|
|
148
|
-
<ClearedCount count={f.counts.high} severity="high" />
|
|
149
|
-
</Fragment>
|
|
150
|
-
))}
|
|
151
|
-
{upgrades.length > UPGRADES_SHOWN && (
|
|
152
|
-
<button type="button" onClick={() => open({ by: 'fix' })} className="col-span-4 justify-self-start text-accent-text hover:underline">
|
|
153
|
-
{upgrades.length - UPGRADES_SHOWN} more {upgrades.length - UPGRADES_SHOWN === 1 ? 'upgrade' : 'upgrades'} →
|
|
154
|
-
</button>
|
|
155
|
-
)}
|
|
156
|
-
</div>
|
|
157
|
-
)}
|
|
158
|
-
</div>
|
|
159
|
-
)}
|
|
160
|
-
{advisory && <div className="mt-3">{advisory}</div>}
|
|
58
|
+
<div className="flex flex-col gap-3 text-sm">
|
|
59
|
+
{images.map((img) => card(img.id, (
|
|
60
|
+
<>
|
|
61
|
+
<span className="flex flex-wrap items-baseline gap-x-2">
|
|
62
|
+
{containerName(img.workloads)}
|
|
63
|
+
<ImageName image={img.image} className="text-xs text-theme-text-tertiary" />
|
|
64
|
+
</span>
|
|
65
|
+
<span className="flex flex-wrap items-center gap-x-3">
|
|
66
|
+
{img.findingsUnread ? <span className="text-xs text-warning-text">Findings not read</span> : <SeverityCounts counts={img.counts} />}
|
|
67
|
+
<span className="text-xs text-theme-text-secondary">{img.findingsUnread ? '' : `${img.fixable.critical + img.fixable.high + img.fixable.medium + img.fixable.low + img.fixable.unknown} with a fix · `}scanned {formatRelativeAgeTime(img.scannedAt)}</span>
|
|
68
|
+
</span>
|
|
69
|
+
<SharedWith others={[...new Set(img.workloads.filter((w) => !isThis(w)).map((w) => `${w.namespace}/${w.name}`))]} partial={img.workloads.length < img.workloadsTotal} />
|
|
70
|
+
</>
|
|
71
|
+
)))}
|
|
72
|
+
{Boolean(data?.unscanned?.length) && (
|
|
73
|
+
<button type="button" onClick={() => open()} className="self-start text-xs text-accent-text hover:underline">
|
|
74
|
+
View unscanned images in this workload →
|
|
75
|
+
</button>
|
|
76
|
+
)}
|
|
77
|
+
{upgrades.length > 0 && (
|
|
78
|
+
// One grid so packages, targets and counts line up; Critical and
|
|
79
|
+
// High are what decide which upgrade comes first.
|
|
80
|
+
<div className="grid grid-cols-[minmax(0,max-content)_minmax(0,1fr)_2rem_2.5rem] items-baseline gap-x-3 gap-y-1 text-xs">
|
|
81
|
+
<span className="col-span-2 font-medium text-theme-text-secondary">Upgrade first</span>
|
|
82
|
+
<span className="text-right text-theme-text-tertiary">C</span>
|
|
83
|
+
<span className="text-right text-theme-text-tertiary">H</span>
|
|
84
|
+
{upgrades.slice(0, UPGRADES_SHOWN).map((f) => (
|
|
85
|
+
<Fragment key={`${f.packageType ?? ''}/${f.package}/${f.to ?? (f.fixedVersions ?? []).join('|')}`}>
|
|
86
|
+
<span className="truncate font-mono text-theme-text-primary">{f.package}</span>
|
|
87
|
+
{f.to
|
|
88
|
+
? <span className="flex min-w-0 items-baseline gap-1 font-mono"><span className="text-theme-text-tertiary">→</span><FixVersion installed={f.from.join(', ')} target={f.to} showInstalled={false} /></span>
|
|
89
|
+
: <span className="truncate font-mono text-theme-text-tertiary">fixed in {(f.fixedVersions ?? []).join(', ')}</span>}
|
|
90
|
+
<ClearedCount count={f.counts.critical} severity="critical" />
|
|
91
|
+
<ClearedCount count={f.counts.high} severity="high" />
|
|
92
|
+
</Fragment>
|
|
93
|
+
))}
|
|
94
|
+
{upgrades.length > UPGRADES_SHOWN && (
|
|
95
|
+
<button type="button" onClick={() => open({ by: 'fix' })} className="col-span-4 justify-self-start text-accent-text hover:underline">
|
|
96
|
+
{upgrades.length - UPGRADES_SHOWN} more {upgrades.length - UPGRADES_SHOWN === 1 ? 'upgrade' : 'upgrades'} →
|
|
97
|
+
</button>
|
|
98
|
+
)}
|
|
99
|
+
</div>
|
|
100
|
+
)}
|
|
101
|
+
</div>
|
|
161
102
|
</Section>
|
|
162
103
|
)
|
|
163
104
|
}
|
|
@@ -88,7 +88,7 @@ export const RELEASE_NOTES: ReleaseNotes[] = [
|
|
|
88
88
|
id: 'java4shell-check',
|
|
89
89
|
icon: ScanSearch,
|
|
90
90
|
title: 'Check for Java4Shell',
|
|
91
|
-
description: '
|
|
91
|
+
description: 'Find affected Java versions in Checks or with radar check java4shell. Node CPU features help prioritize fixes. Works without Trivy.',
|
|
92
92
|
importance: 7,
|
|
93
93
|
path: '/checks/vulnerabilities',
|
|
94
94
|
cta: 'Open Java4Shell check',
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { renderToStaticMarkup } from 'react-dom/server'
|
|
2
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
3
|
+
import { MemoryRouter } from 'react-router-dom'
|
|
4
|
+
import { expect, it, vi } from 'vitest'
|
|
5
|
+
import { ApiError } from '../../api/client'
|
|
6
|
+
import { getApiBase } from '../../api/config'
|
|
7
|
+
import { NavCustomizationProvider } from '../../context/NavCustomization'
|
|
8
|
+
import { WorkloadCostRightsizing } from '../resource/DatadogWorkloadCharts'
|
|
9
|
+
import { MetricsTabContent } from './WorkloadView'
|
|
10
|
+
|
|
11
|
+
vi.mock('../resource/PrometheusChartsGrid', () => ({
|
|
12
|
+
PrometheusChartsGrid: ({ showRightsizing = true, workloadTotals }: { showRightsizing?: boolean; workloadTotals?: React.ReactNode }) =>
|
|
13
|
+
<div>Prom charts{workloadTotals}{showRightsizing && <p>Prom recommendation</p>}</div>,
|
|
14
|
+
}))
|
|
15
|
+
vi.mock('../resource/RightsizingStrip', () => ({
|
|
16
|
+
RightsizingPanel: () => <p>Prom recommendation</p>,
|
|
17
|
+
RightsizingStrip: () => <p>Prom recommendation</p>,
|
|
18
|
+
}))
|
|
19
|
+
vi.mock('../resource/DatadogRightsizingPanel', () => ({
|
|
20
|
+
DatadogRightsizingPanel: () => <p>DD recommendation</p>,
|
|
21
|
+
}))
|
|
22
|
+
vi.mock('../resource/RestartChart', () => ({ RestartEventLane: () => null }))
|
|
23
|
+
|
|
24
|
+
function render(status: object | Error, required = true) {
|
|
25
|
+
const client = new QueryClient({ defaultOptions: { queries: { retryOnMount: false } } })
|
|
26
|
+
const queryKey = ['datadog-metrics-status', getApiBase()]
|
|
27
|
+
if (status instanceof Error) {
|
|
28
|
+
const query = client.getQueryCache().build(client, { queryKey })
|
|
29
|
+
query.setState({ status: 'error', error: status })
|
|
30
|
+
} else {
|
|
31
|
+
client.setQueryData(queryKey, status)
|
|
32
|
+
}
|
|
33
|
+
const workload = { kind: 'Deployment', namespace: 'shop', name: 'api' }
|
|
34
|
+
function view(children: React.ReactNode) {
|
|
35
|
+
return renderToStaticMarkup(
|
|
36
|
+
<MemoryRouter><NavCustomizationProvider value={{ embedded: true, rightsizingProviderStatus: required }}>
|
|
37
|
+
<QueryClientProvider client={client}>{children}</QueryClientProvider>
|
|
38
|
+
</NavCustomizationProvider></MemoryRouter>,
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
const metrics = view(<MetricsTabContent {...workload} resource={{}} expanded />)
|
|
42
|
+
const drawer = view(<MetricsTabContent {...workload} resource={{}} expanded={false} />)
|
|
43
|
+
const cost = view(<WorkloadCostRightsizing {...workload} />)
|
|
44
|
+
client.clear()
|
|
45
|
+
return { cost, metrics, drawer }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
it.each([
|
|
49
|
+
[{ configured: false, rightsizingProvider: 'datadog' }, 'no usable rightsizing connection'],
|
|
50
|
+
[{ configured: false }, 'could not determine the rightsizing source'],
|
|
51
|
+
[new ApiError('Cluster missing', 404), 'could not determine the rightsizing source'],
|
|
52
|
+
[new ApiError('Gateway down', 503), 'could not determine the rightsizing source'],
|
|
53
|
+
])('keeps Prom charts available and withholds sizing when its selection is unresolved', (status, reason) => {
|
|
54
|
+
const { cost, metrics, drawer } = render(status)
|
|
55
|
+
expect(metrics).toContain('Prom charts')
|
|
56
|
+
for (const panel of [metrics, drawer, cost]) {
|
|
57
|
+
expect(panel).toContain(reason)
|
|
58
|
+
expect(panel).not.toContain('Prom recommendation')
|
|
59
|
+
expect(panel).not.toContain('DD recommendation')
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it.each([
|
|
64
|
+
[{ configured: false, rightsizingProvider: 'prometheus' }, 'Prom charts', 'Prom recommendation'],
|
|
65
|
+
[{ configured: true, rightsizingProvider: 'prometheus' }, 'Datadog', 'Prom recommendation'],
|
|
66
|
+
[{ configured: false, rightsizingProvider: 'datadog', rightsizing: true }, 'Prom charts', 'DD recommendation'],
|
|
67
|
+
[{ configured: true, rightsizingProvider: 'datadog', rightsizing: true }, 'Datadog', 'DD recommendation'],
|
|
68
|
+
])('resolves charts independently of the single selected sizing provider', (status, charts, expected) => {
|
|
69
|
+
const { cost, metrics, drawer } = render(status)
|
|
70
|
+
expect(metrics).toContain(charts)
|
|
71
|
+
for (const panel of [metrics, drawer, cost]) {
|
|
72
|
+
expect(panel.match(/(?:DD|Prom) recommendation/g)).toEqual([expected])
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
it('keeps Prometheus sizing for chart-only Hubs and recognizes a missing status route', () => {
|
|
77
|
+
const absentRoute = new ApiError('Not found', 404, {}, { unknownRoute: true })
|
|
78
|
+
expect(render(absentRoute, false).cost).toContain('Prom recommendation')
|
|
79
|
+
expect(render(absentRoute).cost).not.toContain('Prom recommendation')
|
|
80
|
+
expect(render(new ApiError('Cluster unavailable', 404), false).cost).not.toContain('Prom recommendation')
|
|
81
|
+
expect(render({ configured: true }, false).cost).toContain('Prom recommendation')
|
|
82
|
+
expect(render({ configured: false }, false).cost).toContain('Prom recommendation')
|
|
83
|
+
})
|
|
@@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'
|
|
|
2
2
|
|
|
3
3
|
import { gitOpsOwnerFromRelationships } from '@skyhook-io/k8s-ui'
|
|
4
4
|
import type { Relationships } from '../../types'
|
|
5
|
-
import { collectServingRefs, memberOverviewParams, supportsBatchExecution } from './WorkloadView'
|
|
5
|
+
import { collectServingRefs, isPrometheusMetricsAvailable, memberOverviewParams, supportsBatchExecution } from './WorkloadView'
|
|
6
6
|
import { findInheritedGitOpsLookupRef } from '../../hooks/useResolvedGitOpsOwner'
|
|
7
7
|
|
|
8
8
|
describe('findInheritedGitOpsLookupRef', () => {
|
|
@@ -93,3 +93,24 @@ describe('memberOverviewParams', () => {
|
|
|
93
93
|
expect(next.get('apiGroup')).toBe('jobset.x-k8s.io')
|
|
94
94
|
})
|
|
95
95
|
})
|
|
96
|
+
|
|
97
|
+
describe('isPrometheusMetricsAvailable', () => {
|
|
98
|
+
it('offers metrics for a core Node', () => {
|
|
99
|
+
expect(isPrometheusMetricsAvailable('Node', { apiVersion: 'v1', kind: 'Node' }, true)).toBe(true)
|
|
100
|
+
expect(isPrometheusMetricsAvailable('Node', undefined, true)).toBe(true)
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
it('offers no metrics for a Longhorn Node', () => {
|
|
104
|
+
const longhornNode = { apiVersion: 'longhorn.io/v1beta2', kind: 'Node' }
|
|
105
|
+
expect(isPrometheusMetricsAvailable('Node', longhornNode, false)).toBe(false)
|
|
106
|
+
expect(isPrometheusMetricsAvailable('Node', longhornNode, true)).toBe(false)
|
|
107
|
+
expect(isPrometheusMetricsAvailable('Node', undefined, false)).toBe(false)
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
it('keeps the workload rules', () => {
|
|
111
|
+
expect(isPrometheusMetricsAvailable('Deployment', {}, false)).toBe(true)
|
|
112
|
+
expect(isPrometheusMetricsAvailable('Pod', { status: { phase: 'Pending' } }, false)).toBe(false)
|
|
113
|
+
expect(isPrometheusMetricsAvailable('Pod', { status: { phase: 'Running' } }, false)).toBe(true)
|
|
114
|
+
expect(isPrometheusMetricsAvailable('ConfigMap', {}, false)).toBe(false)
|
|
115
|
+
})
|
|
116
|
+
})
|
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
} from '@skyhook-io/k8s-ui'
|
|
38
38
|
import type { ServicePortRenderProps } from '@skyhook-io/k8s-ui/components/resources/renderers/ServiceRenderer'
|
|
39
39
|
import { isJobSetV1Alpha2 } from '@skyhook-io/k8s-ui/components/resources/resource-utils-jobset-lws'
|
|
40
|
+
import { isCoreNode as isCoreNodeObject } from '@skyhook-io/k8s-ui/components/resources/resource-utils'
|
|
40
41
|
import { SUBSTRATE_GROUP } from '@skyhook-io/k8s-ui/components/resources/resource-utils-agent-runtimes'
|
|
41
42
|
import type { SelectedResource, ResourceRef, Relationships, ResourceWithRelationships } from '../../types'
|
|
42
43
|
import { CronJobSchedulingContext, CronJobSchedulingDetails } from './CronJobSchedulingEvidence'
|
|
@@ -99,10 +100,12 @@ import {
|
|
|
99
100
|
fetchJSON,
|
|
100
101
|
fetchYamlSchemas,
|
|
101
102
|
} from '../../api/client'
|
|
102
|
-
import { PrometheusCharts, isPrometheusSupported } from '../resource/PrometheusCharts'
|
|
103
|
+
import { TIME_RANGES, PrometheusCharts, isPrometheusSupported } from '../resource/PrometheusCharts'
|
|
104
|
+
import { RightsizingStrip } from '../resource/RightsizingStrip'
|
|
103
105
|
import { PrometheusChartsGrid } from '../resource/PrometheusChartsGrid'
|
|
106
|
+
import { DatadogSetupHint, DatadogWorkloadCharts, useDatadogWorkloadCharts, WorkloadCostRightsizing } from '../resource/DatadogWorkloadCharts'
|
|
107
|
+
import { useNavCustomization } from '../../context/NavCustomization'
|
|
104
108
|
import { RestartEventLane } from '../resource/RestartChart'
|
|
105
|
-
import { RightsizingPanel } from '../resource/RightsizingStrip'
|
|
106
109
|
import { WorkloadCostTab } from '../cost/WorkloadCostTab'
|
|
107
110
|
import { isOpenCostWorkloadKind } from '../cost/kinds'
|
|
108
111
|
import { isRadarFeatureUnsupported } from '../../api/radarFeatures'
|
|
@@ -178,6 +181,14 @@ export function supportsBatchExecution(kind: string, apiKind: string, group?: st
|
|
|
178
181
|
return true
|
|
179
182
|
}
|
|
180
183
|
|
|
184
|
+
// Longhorn serves a `nodes` plural whose objects are also Kind Node; node metrics
|
|
185
|
+
// only exist for the core Node.
|
|
186
|
+
export function isPrometheusMetricsAvailable(kind: string, resource: any, coreNodeRoute: boolean): boolean {
|
|
187
|
+
if (!isPrometheusSupported(kind)) return false
|
|
188
|
+
if (kind === 'Node') return coreNodeRoute && isCoreNodeObject(resource)
|
|
189
|
+
return !(kind === 'Pod' && resource?.status?.phase === 'Pending')
|
|
190
|
+
}
|
|
191
|
+
|
|
181
192
|
// ============================================================================
|
|
182
193
|
// ROUTE WRAPPER — parses kind/ns/name from URL
|
|
183
194
|
// ============================================================================
|
|
@@ -390,6 +401,7 @@ function useActionsBarProps(
|
|
|
390
401
|
const argoResumeMutation = useArgoResume()
|
|
391
402
|
const { upgrade: argoResumeUpgrade, blockedReason: argoResumeBlockedReason } = useRadarFeature('argoAutoSyncEnable')
|
|
392
403
|
const { support: argoInheritanceSupport } = useRadarFeature('argoSyncInheritance')
|
|
404
|
+
const { support: cronJobJobNameSupport } = useRadarFeature('cronJobTriggerJobName')
|
|
393
405
|
|
|
394
406
|
const {
|
|
395
407
|
data: cascadePreview,
|
|
@@ -487,9 +499,11 @@ function useActionsBarProps(
|
|
|
487
499
|
? (params: { namespace: string; name: string }) =>
|
|
488
500
|
rolloutDialogPromote.mutateAsync({ action: 'promote-full', ...params })
|
|
489
501
|
: undefined,
|
|
502
|
+
// mutateAsync, not mutate: the Job name dialog stays open when this rejects.
|
|
490
503
|
onTriggerCronJob: (params: Parameters<typeof triggerCronJobMutation.mutate>[0]) =>
|
|
491
|
-
triggerCronJobMutation.
|
|
504
|
+
triggerCronJobMutation.mutateAsync(params),
|
|
492
505
|
isTriggeringCronJob: triggerCronJobMutation.isPending,
|
|
506
|
+
cronJobTriggerDialog: cronJobJobNameSupport === 'supported',
|
|
493
507
|
onSuspendCronJob: (params: Parameters<typeof suspendCronJobMutation.mutate>[0]) =>
|
|
494
508
|
suspendCronJobMutation.mutate(params),
|
|
495
509
|
isSuspendingCronJob: suspendCronJobMutation.isPending,
|
|
@@ -1351,7 +1365,7 @@ export function WorkloadView({
|
|
|
1351
1365
|
)}
|
|
1352
1366
|
renderCostTab={({ kind, namespace: ns, name: n }) => (
|
|
1353
1367
|
<div className="space-y-4">
|
|
1354
|
-
<
|
|
1368
|
+
<WorkloadCostRightsizing kind={kind} namespace={ns} name={n} />
|
|
1355
1369
|
<WorkloadCostTab kind={kind} namespace={ns} name={n} />
|
|
1356
1370
|
</div>
|
|
1357
1371
|
)}
|
|
@@ -1377,7 +1391,7 @@ export function WorkloadView({
|
|
|
1377
1391
|
/>
|
|
1378
1392
|
)}
|
|
1379
1393
|
isMetricsAvailable={(kind, res) =>
|
|
1380
|
-
isSubstrateWorkerPool || (
|
|
1394
|
+
isSubstrateWorkerPool || isPrometheusMetricsAvailable(kind, res, isNode)
|
|
1381
1395
|
}
|
|
1382
1396
|
isCostAvailable={(kind) => isOpenCostWorkloadKind(kind)}
|
|
1383
1397
|
onDuplicate={handleDuplicate}
|
|
@@ -2255,7 +2269,7 @@ function DiagnoseInlineSection({ kind, namespace, name, group, onOpenReachabilit
|
|
|
2255
2269
|
// Drawer mode: single chart + category tabs (compact for ~500px width).
|
|
2256
2270
|
// Full-screen mode: multi-chart grid so CPU + Memory + Network can be
|
|
2257
2271
|
// compared side-by-side without tab switching.
|
|
2258
|
-
function MetricsTabContent({
|
|
2272
|
+
export function MetricsTabContent({
|
|
2259
2273
|
kind,
|
|
2260
2274
|
namespace,
|
|
2261
2275
|
name,
|
|
@@ -2271,20 +2285,47 @@ function MetricsTabContent({
|
|
|
2271
2285
|
/** False when content follows, so the tab scrolls everything as one. */
|
|
2272
2286
|
fill?: boolean
|
|
2273
2287
|
}) {
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2288
|
+
const [params] = useSearchParams()
|
|
2289
|
+
const range = TIME_RANGES.find((option) => option.value === params.get('metricsRange'))?.value ?? '1h'
|
|
2290
|
+
const workload = { kind, namespace, name }
|
|
2291
|
+
const { embedded = false } = useNavCustomization()
|
|
2292
|
+
const { charts, rightsizing, checking, configured, setup } = useDatadogWorkloadCharts(workload, range, embedded)
|
|
2293
|
+
if (configured) {
|
|
2294
|
+
const workloadTotals = (
|
|
2295
|
+
<DatadogWorkloadCharts charts={charts.data?.configured ? charts.data.charts : undefined}
|
|
2296
|
+
loading={charts.isLoading} error={charts.error} onRetry={() => void charts.refetch()} />
|
|
2297
|
+
)
|
|
2298
|
+
if (rightsizing) return (
|
|
2299
|
+
<div className={fill ? 'h-full overflow-auto' : undefined}>
|
|
2300
|
+
<PrometheusChartsGrid {...workload} resource={resource} workloadTotals={workloadTotals} fill={false} showRightsizing={false} />
|
|
2301
|
+
<div className="px-4 pb-4">{rightsizing}</div>
|
|
2281
2302
|
</div>
|
|
2282
2303
|
)
|
|
2304
|
+
return <PrometheusChartsGrid {...workload} resource={resource} workloadTotals={workloadTotals} fill={fill} />
|
|
2283
2305
|
}
|
|
2306
|
+
if (checking) return <p role="status" className="p-4 text-sm text-theme-text-secondary">Loading workload metrics…</p>
|
|
2284
2307
|
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2308
|
+
const setupHint = setup && <DatadogSetupHint owner={setup === 'owner'} />
|
|
2309
|
+
if (rightsizing || !expanded) {
|
|
2310
|
+
return (
|
|
2311
|
+
<div className={fill ? 'h-full overflow-auto' : undefined}>
|
|
2312
|
+
{setupHint}
|
|
2313
|
+
{expanded
|
|
2314
|
+
? <PrometheusChartsGrid {...workload} resource={resource} fill={false} showRightsizing={false} />
|
|
2315
|
+
: <DrawerMetricsContent {...workload} resource={resource} />}
|
|
2316
|
+
<div className="px-4 pb-4">{rightsizing ?? <RightsizingStrip {...workload} />}</div>
|
|
2317
|
+
</div>
|
|
2318
|
+
)
|
|
2319
|
+
}
|
|
2320
|
+
if (!fill) return <PrometheusChartsGrid {...workload} resource={resource} fill={false} />
|
|
2321
|
+
return (
|
|
2322
|
+
<div className="flex flex-col h-full">
|
|
2323
|
+
{setupHint}
|
|
2324
|
+
<div className="flex-1 min-h-0">
|
|
2325
|
+
<PrometheusChartsGrid {...workload} resource={resource} />
|
|
2326
|
+
</div>
|
|
2327
|
+
</div>
|
|
2328
|
+
)
|
|
2288
2329
|
}
|
|
2289
2330
|
|
|
2290
2331
|
function DrawerMetricsContent({
|
|
@@ -44,6 +44,7 @@ describe('shouldAutoRetryConnection', () => {
|
|
|
44
44
|
expect(shouldAutoRetryConnection('config')).toBe(false)
|
|
45
45
|
expect(shouldAutoRetryConnection('rbac')).toBe(false)
|
|
46
46
|
expect(shouldAutoRetryConnection('settings')).toBe(false)
|
|
47
|
+
expect(shouldAutoRetryConnection('switch-stopped')).toBe(false)
|
|
47
48
|
})
|
|
48
49
|
})
|
|
49
50
|
|