@skyhook-io/radar-app 1.22.2 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -8
- package/src/App.tsx +35 -10
- package/src/RadarApp.basename.test.tsx +177 -0
- package/src/RadarApp.settings.test.tsx +33 -0
- package/src/api/agentSandbox.ts +259 -0
- package/src/api/client.autoPromConnect.test.tsx +43 -0
- package/src/api/client.metricsRelayCheck.test.tsx +134 -0
- package/src/api/client.ts +122 -24
- package/src/api/cloudInstallDiscover.test.tsx +76 -0
- package/src/api/diagnose.ts +4 -0
- package/src/api/kagent.test.ts +82 -0
- package/src/api/kagent.ts +230 -0
- package/src/api/prometheusCharts.ts +5 -0
- package/src/api/radarFeatures.test.ts +9 -0
- package/src/api/radarFeatures.ts +13 -0
- package/src/api/substrateWorkspace.test.ts +72 -0
- package/src/api/substrateWorkspace.ts +1394 -0
- package/src/api/vulnerabilities.ts +207 -9
- package/src/api/workloadSource.test.tsx +315 -0
- package/src/api/workloadSource.ts +128 -12
- package/src/components/CloudConnectFlow.tsx +46 -7
- package/src/components/CloudFunnelButton.test.tsx +193 -7
- package/src/components/CloudFunnelButton.tsx +127 -32
- package/src/components/SelfManagedStart.tsx +12 -2
- package/src/components/agentsandbox/AgentSandboxKindLists.tsx +41 -0
- package/src/components/agentsandbox/AgentSandboxLists.test.tsx +410 -0
- package/src/components/agentsandbox/AgentSandboxOverview.test.tsx +333 -0
- package/src/components/agentsandbox/AgentSandboxOverview.tsx +555 -0
- package/src/components/agentsandbox/AgentSandboxSidebar.test.tsx +97 -0
- package/src/components/agentsandbox/AgentSandboxSummary.test.tsx +439 -0
- package/src/components/agentsandbox/AgentSandboxSummary.tsx +956 -0
- package/src/components/agentsandbox/AgentSandboxTables.tsx +966 -0
- package/src/components/agentsandbox/AgentSandboxView.tsx +34 -0
- package/src/components/agentsandbox/agentsandbox.fixtures.ts +135 -0
- package/src/components/agentsandbox/data.ts +135 -0
- package/src/components/agentsandbox/host.test.ts +27 -0
- package/src/components/agentsandbox/host.tsx +85 -0
- package/src/components/agentsandbox/labels.test.ts +42 -0
- package/src/components/agentsandbox/labels.ts +146 -0
- package/src/components/agentsandbox/listFilters.ts +85 -0
- package/src/components/agentsandbox/lists.ts +52 -0
- package/src/components/agentsandbox/routes.ts +23 -0
- package/src/components/agentsandbox/shared.tsx +321 -0
- package/src/components/agentsandbox/useAgentSandboxSidebarWorkspace.ts +69 -0
- package/src/components/agentsandbox/workspace.fixtures.ts +125 -0
- package/src/components/agentsandbox/workspace.tsx +258 -0
- package/src/components/agentsandbox/workspaceRoute.ts +18 -0
- package/src/components/applications/ApplicationsView.openResource.test.tsx +248 -3
- package/src/components/applications/ApplicationsView.tsx +156 -3
- package/src/components/audit/VulnerabilitiesColumns.test.tsx +487 -0
- package/src/components/audit/VulnerabilitiesRisk.test.tsx +318 -0
- package/src/components/audit/VulnerabilitiesView.test.tsx +458 -13
- package/src/components/audit/VulnerabilitiesView.tsx +639 -199
- package/src/components/cloudHints/AgentSetupCloudRow.tsx +28 -0
- package/src/components/cloudHints/CloudHintLink.tsx +29 -0
- package/src/components/cloudHints/SharedInstallAiLine.tsx +36 -0
- package/src/components/cloudHints/cloudHints.test.ts +126 -0
- package/src/components/cloudHints/cloudHints.ts +131 -0
- package/src/components/cloudHints/cloudHintsGate.test.tsx +70 -0
- package/src/components/cloudHints/cloudLinks.test.ts +52 -0
- package/src/components/cloudHints/cloudLinks.ts +31 -0
- package/src/components/cloudHints/hintStorage.ts +28 -0
- package/src/components/cnpg/CNPGView.tsx +4 -7
- package/src/components/diagnose/AgentSetupNotice.tsx +5 -0
- package/src/components/diagnose/DiagnoseContext.tsx +7 -0
- package/src/components/diagnose/DiagnoseSurface.escape.test.tsx +215 -0
- package/src/components/diagnose/DiagnoseSurface.tsx +57 -1
- package/src/components/gitops/RemoteDestinationCloudHint.tsx +6 -14
- package/src/components/home/HomeAgentBlock.tsx +2 -0
- package/src/components/home/HomeView.tsx +3 -3
- package/src/components/home/MCPSetupDialog.test.tsx +9 -0
- package/src/components/home/MCPSetupDialog.tsx +6 -2
- package/src/components/home/McpCloudLine.test.tsx +162 -0
- package/src/components/home/McpCloudLine.tsx +95 -0
- package/src/components/home/ProblemsPanel.investigate.test.tsx +2 -2
- package/src/components/home/mcpToolCatalog.test.ts +10 -0
- package/src/components/home/mcpToolCatalog.ts +4 -4
- package/src/components/issues/ClusterSchedulingBlockerRow.tsx +35 -0
- package/src/components/issues/IssuesPane.render.test.tsx +36 -1
- package/src/components/issues/IssuesPane.tsx +181 -23
- package/src/components/issues/SinceLastVisitRow.render.test.tsx +302 -0
- package/src/components/issues/SinceLastVisitRow.tsx +71 -0
- package/src/components/issues/sinceLastVisit.test.ts +266 -0
- package/src/components/issues/sinceLastVisit.ts +439 -0
- package/src/components/kagent/KagentAgentRenderer.test.ts +32 -0
- package/src/components/kagent/KagentAgentRenderer.tsx +87 -0
- package/src/components/kagent/KagentAgentSessions.test.tsx +166 -0
- package/src/components/kagent/KagentAgentSessions.tsx +124 -0
- package/src/components/kagent/KagentDetailPage.tsx +106 -0
- package/src/components/kagent/KagentLists.tsx +412 -0
- package/src/components/kagent/KagentOverview.tsx +234 -0
- package/src/components/kagent/KagentPages.tsx +690 -0
- package/src/components/kagent/KagentRuntimeTabs.test.tsx +219 -0
- package/src/components/kagent/KagentRuntimeTabs.tsx +283 -0
- package/src/components/kagent/KagentSidebar.test.tsx +112 -0
- package/src/components/kagent/KagentView.tsx +109 -0
- package/src/components/kagent/KagentWorkspace.test.tsx +876 -0
- package/src/components/kagent/host.tsx +144 -0
- package/src/components/kagent/routes.ts +31 -0
- package/src/components/kagent/shared.tsx +336 -0
- package/src/components/kagent/useKagentRuntime.test.tsx +77 -0
- package/src/components/kagent/useKagentSidebarWorkspace.ts +67 -0
- package/src/components/kagent/workspace.fixtures.ts +108 -0
- package/src/components/kagent/workspaceRoute.ts +18 -0
- package/src/components/resource/MetricsNotConnected.test.tsx +28 -0
- package/src/components/resource/MetricsNotConnected.tsx +10 -7
- package/src/components/resource/PrometheusCharts.tsx +10 -1
- package/src/components/resource/PrometheusChartsGrid.render.test.tsx +9 -0
- package/src/components/resource/PrometheusChartsGrid.tsx +3 -3
- package/src/components/resource/SubstrateHealthCharts.test.tsx +13 -1
- package/src/components/resource/SubstrateHealthCharts.tsx +9 -15
- package/src/components/resources/ResourceDetailDrawer.tsx +1 -0
- package/src/components/resources/ResourcesView.tsx +2 -6
- package/src/components/resources/renderers/PodRenderer.tsx +8 -2
- package/src/components/settings/LocalIntegrationStatus.test.tsx +1 -0
- package/src/components/settings/LocalIntegrationStatus.tsx +3 -2
- package/src/components/settings/SettingsDialog.tsx +84 -16
- package/src/components/settings/SubstrateSettings.lifecycle.test.tsx +210 -0
- package/src/components/settings/SubstrateSettings.test.tsx +131 -0
- package/src/components/settings/SubstrateSettings.tsx +544 -0
- package/src/components/settings/settings-state.test.ts +21 -3
- package/src/components/settings/settings-state.ts +13 -3
- package/src/components/share/ShareLinkButton.test.tsx +360 -0
- package/src/components/share/ShareLinkButton.tsx +391 -0
- package/src/components/share/openShareInCloud.test.ts +29 -0
- package/src/components/share/openShareInCloud.ts +10 -0
- package/src/components/share/shareLink.test.ts +129 -0
- package/src/components/share/shareLink.ts +175 -0
- package/src/components/substrate/SubstrateActorDrawer.tsx +87 -0
- package/src/components/substrate/SubstrateActorOverview.tsx +489 -0
- package/src/components/substrate/SubstrateActorPage.tsx +384 -0
- package/src/components/substrate/SubstrateActors.test.tsx +1094 -0
- package/src/components/substrate/SubstrateActors.tsx +612 -0
- package/src/components/substrate/SubstrateAttentionList.tsx +441 -0
- package/src/components/substrate/SubstrateConnect.tsx +88 -0
- package/src/components/substrate/SubstrateOverview.test.tsx +396 -0
- package/src/components/substrate/SubstrateOverview.tsx +575 -0
- package/src/components/substrate/SubstratePages.test.tsx +478 -0
- package/src/components/substrate/SubstratePool.test.tsx +462 -0
- package/src/components/substrate/SubstratePoolPage.tsx +95 -0
- package/src/components/substrate/SubstratePoolSummary.tsx +485 -0
- package/src/components/substrate/SubstrateSidebar.test.tsx +101 -0
- package/src/components/substrate/SubstrateStateBar.tsx +63 -0
- package/src/components/substrate/SubstrateTemplates.tsx +376 -0
- package/src/components/substrate/SubstrateView.tsx +173 -0
- package/src/components/substrate/SubstrateWorkerPodContext.tsx +73 -0
- package/src/components/substrate/SubstrateWorkers.tsx +389 -0
- package/src/components/substrate/attention.ts +81 -0
- package/src/components/substrate/contextPin.tsx +69 -0
- package/src/components/substrate/host.tsx +83 -0
- package/src/components/substrate/kubectlTarget.test.tsx +77 -0
- package/src/components/substrate/readings.test.ts +484 -0
- package/src/components/substrate/readings.ts +997 -0
- package/src/components/substrate/routes.ts +103 -0
- package/src/components/substrate/shared.tsx +426 -0
- package/src/components/substrate/substrate.fixtures.ts +325 -0
- package/src/components/substrate/useSubstrateSidebarWorkspace.ts +87 -0
- package/src/components/substrate/workspaceRoute.ts +23 -0
- package/src/components/traffic/TrafficConnectionsTable.test.tsx +9 -0
- package/src/components/traffic/TrafficConnectionsTable.tsx +4 -2
- package/src/components/traffic/TrafficFilterSidebar.tsx +19 -14
- package/src/components/traffic/TrafficFlowList.test.tsx +63 -0
- package/src/components/traffic/TrafficFlowList.tsx +9 -5
- package/src/components/traffic/TrafficGraph.test.tsx +26 -0
- package/src/components/traffic/TrafficGraph.tsx +17 -14
- package/src/components/traffic/TrafficGraphTooLarge.tsx +2 -0
- package/src/components/traffic/TrafficGraphUnavailable.tsx +3 -1
- package/src/components/traffic/TrafficView.tsx +26 -56
- package/src/components/traffic/trafficFilters.test.ts +61 -1
- package/src/components/traffic/trafficFilters.ts +68 -8
- package/src/components/velero/VeleroOverview.tsx +2 -2
- package/src/components/velero/VeleroView.tsx +3 -6
- package/src/components/vulnerabilities/columns.tsx +132 -0
- package/src/components/vulnerabilities/filters.tsx +317 -0
- package/src/components/vulnerabilities/owner.test.ts +54 -0
- package/src/components/vulnerabilities/owner.tsx +163 -0
- package/src/components/vulnerabilities/parts.test.ts +126 -12
- package/src/components/vulnerabilities/parts.tsx +612 -52
- package/src/components/vulnerabilities/traffic.test.tsx +65 -0
- package/src/components/vulnerabilities/traffic.tsx +40 -0
- package/src/components/workload/WorkloadView.substrateVersion.test.tsx +88 -0
- package/src/components/workload/WorkloadView.tsx +52 -13
- package/src/components/workspace/layout.tsx +13 -7
- package/src/components/workspace/sidebar.test.ts +48 -0
- package/src/components/workspace/sidebar.ts +73 -3
- package/src/components/workspace/table.ts +2 -1
- package/src/contexts/RegistryAccessMode.test.tsx +51 -0
- package/src/contexts/RegistryAccessMode.tsx +25 -0
- package/src/integrations/resourceHost.ts +12 -6
- package/src/integrations/resourceHosts.test.tsx +27 -1
- package/src/integrations/resourceHosts.tsx +15 -7
- package/src/integrations/sidebarWorkspaces.test.tsx +63 -0
- package/src/integrations/sidebarWorkspaces.ts +41 -0
- package/src/integrations/workspaceRoute.ts +1 -1
- package/src/integrations/workspaceRoutes.ts +7 -1
- package/src/integrations/workspaceScreens.tsx +6 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
import { renderToStaticMarkup } from 'react-dom/server'
|
|
3
|
+
import { MemoryRouter } from 'react-router-dom'
|
|
4
|
+
import { describe, expect, it, vi } from 'vitest'
|
|
5
|
+
|
|
6
|
+
const summaryQuery = vi.hoisted(() => ({ support: 'supported', isPending: true }))
|
|
7
|
+
|
|
8
|
+
vi.mock('../../context/ConnectionContext', () => ({ useConnection: () => ({ connection: { context: 'kind-demo' } }) }))
|
|
9
|
+
vi.mock('../../api/apiResources', () => ({ useAPIResources: () => ({ data: [{ group: 'agents.x-k8s.io' }], isPending: false, isError: false }) }))
|
|
10
|
+
vi.mock('../../api/client', async (importOriginal) => ({
|
|
11
|
+
...(await importOriginal<typeof import('../../api/client')>()),
|
|
12
|
+
useRadarFeature: () => ({ support: summaryQuery.support }),
|
|
13
|
+
}))
|
|
14
|
+
vi.mock('../../api/agentSandbox', () => ({ useAgentSandboxWorkspace: () => ({ isPending: summaryQuery.isPending }) }))
|
|
15
|
+
vi.mock('./data', async (importOriginal) => ({
|
|
16
|
+
...(await importOriginal<typeof import('./data')>()),
|
|
17
|
+
useAgentSandboxLists: () => ({ data: liveData(), isFetching: false, refetch: () => {}, refreshQueries: [] }),
|
|
18
|
+
}))
|
|
19
|
+
|
|
20
|
+
import { getSandboxClaimStatus, getSandboxStatus, getSandboxWarmPoolStatus } from '@skyhook-io/k8s-ui/components/resources/resource-utils-agent-runtimes'
|
|
21
|
+
import type { AgentSandboxLists } from './data'
|
|
22
|
+
import { ClaimsScreen, SandboxesScreen, WarmPoolsScreen, filterSandboxes, poolNotReadyPath, requestedMode, stateMessage } from './AgentSandboxTables'
|
|
23
|
+
import { SandboxClaimsKindList, SandboxesKindList, SandboxWarmPoolsKindList } from './AgentSandboxKindLists'
|
|
24
|
+
import { AgentSandboxGate } from './shared'
|
|
25
|
+
import { NS, PARTIAL, claim, emptyData, liveClaims, liveData, liveSandboxes, read, sandbox, warmPool } from './agentsandbox.fixtures'
|
|
26
|
+
import { liveWorkspace } from './workspace.fixtures'
|
|
27
|
+
import { serverReadings } from './labels'
|
|
28
|
+
import { QueryClient } from '@tanstack/react-query'
|
|
29
|
+
import { kindToPluralWithGroup } from '../../utils/navigation'
|
|
30
|
+
import { agentSandboxListKey } from './data'
|
|
31
|
+
import { readListFilters, withoutColumn } from './listFilters'
|
|
32
|
+
import { SANDBOX_CLAIM_KIND, SANDBOX_KIND, SANDBOX_WARM_POOL_KIND } from './routes'
|
|
33
|
+
|
|
34
|
+
// The kind lists read the resource list endpoint, with its coverage; the
|
|
35
|
+
// Overview's tests are in AgentSandboxOverview.test.tsx.
|
|
36
|
+
|
|
37
|
+
// renderToStaticMarkup escapes apostrophes; compare against the text a reader sees.
|
|
38
|
+
const text = (html: string) => html.replace(/'/g, "'").replace(/"/g, '"').replace(/&/g, '&').replace(/<!-- -->/g, '')
|
|
39
|
+
const DENIED = { state: 'failed', message: 'forbidden', denied: true } as const
|
|
40
|
+
|
|
41
|
+
function page(node: ReactNode, url = '/') {
|
|
42
|
+
return text(renderToStaticMarkup(<MemoryRouter initialEntries={[url]}>{node}</MemoryRouter>))
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function warmPoolWithoutTemplate() {
|
|
46
|
+
const pool = warmPool('bare')
|
|
47
|
+
delete pool.spec.sandboxTemplateRef
|
|
48
|
+
return pool
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const screenProps = (data: AgentSandboxLists, namespaces: string[] = []) => ({ data, namespaces, onClearNamespaces: () => {}, onInspect: () => {}, inspected: null })
|
|
52
|
+
|
|
53
|
+
function gate(data: AgentSandboxLists, opts: Partial<{ discoveryPending: boolean; discovered: boolean }> = {}) {
|
|
54
|
+
return page(
|
|
55
|
+
<AgentSandboxGate data={data} keys={['sandboxes', 'claims', 'warmPools']} discoveryPending={opts.discoveryPending ?? false} discovered={opts.discovered ?? true} isFetching={false} refetch={() => {}} refreshQueries={[]}>
|
|
56
|
+
<div>screen</div>
|
|
57
|
+
</AgentSandboxGate>,
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
describe('Agent Sandbox kind list gate', () => {
|
|
62
|
+
it('waits for discovery and for a first answer, then shows the screen with what is still loading named on it', () => {
|
|
63
|
+
expect(gate(liveData(), { discoveryPending: true })).toContain('Loading Agent Sandbox')
|
|
64
|
+
expect(gate(liveData({ sandboxes: { state: 'loading' }, claims: { state: 'loading' }, warmPools: { state: 'loading' } }))).toContain('Loading Agent Sandbox')
|
|
65
|
+
expect(gate(liveData({ claims: { state: 'loading' } }))).toContain('screen')
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it('says when Agent Sandbox is not installed', () => {
|
|
69
|
+
expect(gate(liveData(), { discovered: false })).toContain('Agent Sandbox is not installed')
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
it('says a kind this Agent Sandbox version does not serve, rather than that Agent Sandbox is missing', () => {
|
|
73
|
+
const html = gate(liveData({ sandboxes: { state: 'notServed' }, claims: { state: 'notServed' }, warmPools: { state: 'notServed' } }))
|
|
74
|
+
expect(html).toContain('Not served by this Agent Sandbox')
|
|
75
|
+
expect(html).not.toContain('Agent Sandbox is not installed')
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it('tells a denial from a failure, and offers a retry only for the failure', () => {
|
|
79
|
+
const denied = gate(liveData({ sandboxes: DENIED, claims: DENIED, warmPools: DENIED }))
|
|
80
|
+
expect(denied).toContain('Missing permission to list sandboxes.agents.x-k8s.io')
|
|
81
|
+
expect(denied).not.toContain('Retry')
|
|
82
|
+
const failed = gate(liveData({ sandboxes: { state: 'failed', message: 'boom', denied: false }, claims: DENIED, warmPools: DENIED }))
|
|
83
|
+
expect(failed).toContain('Agent Sandbox data unavailable')
|
|
84
|
+
expect(failed).toContain('boom')
|
|
85
|
+
expect(failed).toContain('Retry')
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
describe('Agent Sandbox kind lists', () => {
|
|
90
|
+
it.each([
|
|
91
|
+
['sandboxes', SandboxesKindList, 'bad-image'],
|
|
92
|
+
['sandboxclaims', SandboxClaimsKindList, 'claim-missing-pool'],
|
|
93
|
+
['sandboxwarmpools', SandboxWarmPoolsKindList, 'warm'],
|
|
94
|
+
] as const)('waits for the server summary only on the %s attention segment', (kind, KindList, row) => {
|
|
95
|
+
const list = <KindList namespaces={[]} inspected={null} onClearNamespaces={() => {}} onInspect={() => {}} onCreate={() => {}} />
|
|
96
|
+
const path = `/resources/${kind}`
|
|
97
|
+
const attentionPath = `${path}?segment=attention`
|
|
98
|
+
summaryQuery.support = 'supported'
|
|
99
|
+
summaryQuery.isPending = true
|
|
100
|
+
|
|
101
|
+
const pending = page(list, attentionPath)
|
|
102
|
+
expect(pending).toContain('Loading Agent Sandbox…')
|
|
103
|
+
expect(pending).toContain('Needs attention</button>')
|
|
104
|
+
expect(pending).not.toContain(' need attention')
|
|
105
|
+
expect(pending).not.toContain(`>${row}<`)
|
|
106
|
+
|
|
107
|
+
const all = page(list, path)
|
|
108
|
+
expect(all).not.toContain('Loading Agent Sandbox…')
|
|
109
|
+
expect(all).toContain('Needs attention</button>')
|
|
110
|
+
expect(all).toContain(`>${row}<`)
|
|
111
|
+
|
|
112
|
+
for (const [support, isPending] of [['unsupported', true], ['supported', false]] as const) {
|
|
113
|
+
Object.assign(summaryQuery, { support, isPending })
|
|
114
|
+
const fallback = page(list, attentionPath)
|
|
115
|
+
expect(fallback).not.toContain('Loading Agent Sandbox…')
|
|
116
|
+
expect(fallback).toMatch(/Needs attention<span[^>]*>[1-9]\d*<\/span>/)
|
|
117
|
+
expect(fallback).toContain(`>${row}<`)
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
it('lists sandboxes with their reading, concise reason, owner, expiry, and visible Open affordance, failures first', () => {
|
|
122
|
+
const html = page(<SandboxesScreen {...screenProps(liveData())} />)
|
|
123
|
+
expect(html).toContain('Agent Sandbox')
|
|
124
|
+
// Clickable breadcrumb back to Overview.
|
|
125
|
+
expect(html).toMatch(/<button[^>]*>Agent Sandbox<\/button>/)
|
|
126
|
+
// Single-namespace subtitle shown under All namespaces.
|
|
127
|
+
expect(html).toContain(`in namespace ${NS}`)
|
|
128
|
+
// Segments toolbar includes Needs attention, Ready, and Settled.
|
|
129
|
+
expect(html).toContain('Needs attention')
|
|
130
|
+
expect(html).toContain('Settled')
|
|
131
|
+
expect(html).toContain('Open →')
|
|
132
|
+
expect(html.indexOf('ImagePullBackOff')).toBeLessThan(html.indexOf('>Suspended<'))
|
|
133
|
+
// Plain words on the badge; the controller's code stays on hover.
|
|
134
|
+
for (const label of ['>Image can’t be pulled<', '>Pod failed<', '>Can’t schedule<']) expect(html).toContain(label)
|
|
135
|
+
for (const raw of ['>ImagePullBackOff<', '>PodFailed<', '>Unschedulable<']) expect(html).not.toContain(raw)
|
|
136
|
+
expect(html).toContain('Suspension blocked')
|
|
137
|
+
expect(html).toContain('Conflicting Pod "foreign" is not owned by this Sandbox')
|
|
138
|
+
// Narrow (no matchMedia here): the pool sits under the Sandbox's name, the age under its expiry.
|
|
139
|
+
expect(html).toMatch(/warm pool <span[^>]*><button[^>]*>warm<\/button>/)
|
|
140
|
+
expect(html).toMatch(/expired 1d ago.*?\dd old/)
|
|
141
|
+
expect(html).not.toContain('>Claim or pool<')
|
|
142
|
+
expect(html).not.toContain('>Age<')
|
|
143
|
+
expect(html).toMatch(/expired 1d ago/)
|
|
144
|
+
// The spec's operating mode shows only where the state hasn't caught up with it.
|
|
145
|
+
expect(html).not.toContain('Mode')
|
|
146
|
+
expect(html).not.toContain('requested running')
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
it('explains affected rows concisely: scheduler plain words, stripped container reason, Pod failed hint, and suspension conflict', () => {
|
|
150
|
+
const by = Object.fromEntries(liveSandboxes().map((s) => [s.metadata.name, stateMessage(s, getSandboxStatus(s))]))
|
|
151
|
+
expect(by['warm-4xmkm']).toBe('All nodes have reached their Pod limit')
|
|
152
|
+
expect(by['bad-image']).toBe('Container "agent" is waiting: ImagePullBackOff')
|
|
153
|
+
expect(by['failed']).toContain('Pod exited with failure')
|
|
154
|
+
expect(by['foreign']).toBe('Conflicting Pod "foreign" is not owned by this Sandbox')
|
|
155
|
+
for (const name of ['expired', 'finished', 'running', 'suspended']) expect(by[name], name).toBeUndefined()
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
it('supports Needs attention, Ready, Settled segments and ?state=expired filtering on Sandboxes', () => {
|
|
159
|
+
const attn = page(<SandboxesScreen {...screenProps(liveData())} />, '/resources/sandboxes?segment=attention')
|
|
160
|
+
expect(attn).toContain('bad-image')
|
|
161
|
+
expect(attn).toContain('failed')
|
|
162
|
+
expect(attn).not.toContain('>suspended<')
|
|
163
|
+
const settled = page(<SandboxesScreen {...screenProps(liveData())} />, '/resources/sandboxes?segment=settled')
|
|
164
|
+
expect(settled).toContain('>suspended<')
|
|
165
|
+
expect(settled).toContain('>finished<')
|
|
166
|
+
expect(settled).not.toContain('>bad-image<')
|
|
167
|
+
const expired = page(<SandboxesScreen {...screenProps(liveData())} />, '/resources/sandboxes?state=expired')
|
|
168
|
+
expect(expired).toContain('>expired<')
|
|
169
|
+
expect(expired).not.toContain('>suspended<')
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
it('matches the Sandboxes sidebar badge when a pool finding covers a member', () => {
|
|
173
|
+
const workspace = liveWorkspace()
|
|
174
|
+
const member = 'warm-4xmkm'
|
|
175
|
+
expect(workspace.attention.some((row) => row.subject.name === member)).toBe(false)
|
|
176
|
+
expect(workspace.attention.find((row) => row.rule === 'reserveBelowTarget')?.related?.refs).toContainEqual(expect.objectContaining({ name: member }))
|
|
177
|
+
|
|
178
|
+
const html = page(<SandboxesScreen {...screenProps(liveData())} server={serverReadings(workspace)} />, '/resources/sandboxes?segment=attention')
|
|
179
|
+
expect(html).toMatch(new RegExp(`Needs attention<span[^>]*>${workspace.sidebar.sandboxes.count}</span>`))
|
|
180
|
+
expect(html).toContain(`>${member}<`)
|
|
181
|
+
expect(html).not.toContain('>suspended<')
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
it('says what was requested only where the state differs from it', () => {
|
|
185
|
+
const suspendedAsked = { ...liveSandboxes()[1], spec: { operatingMode: 'Suspended' } }
|
|
186
|
+
const resuming = { ...liveSandboxes().find((s) => s.metadata.name === 'suspended'), spec: { operatingMode: 'Running' } }
|
|
187
|
+
expect(requestedMode(suspendedAsked)).toBe('suspended')
|
|
188
|
+
expect(requestedMode(resuming)).toBe('running')
|
|
189
|
+
for (const s of liveSandboxes()) expect(requestedMode(s), s.metadata.name).toBeUndefined()
|
|
190
|
+
expect(page(<SandboxesScreen {...screenProps(liveData({ sandboxes: [suspendedAsked] }))} />)).toContain('requested suspended')
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
it('shows a claim’s missing warm pool clearly in its column, and supports Claims segments and pool filter', () => {
|
|
194
|
+
const html = page(<ClaimsScreen {...screenProps(liveData())} />)
|
|
195
|
+
expect(html).toContain('>Warm pool not found<')
|
|
196
|
+
expect(html).not.toContain('>WarmPoolNotFound<')
|
|
197
|
+
expect(html).not.toContain('SandboxWarmPool "no-such-pool" not found')
|
|
198
|
+
// Named, not linked, with verified missing tag; the pool it has is linked.
|
|
199
|
+
expect(html).toMatch(/no-such-pool(<\/span>)+<div[^>]*><span[^>]*>not found/)
|
|
200
|
+
expect(html).not.toContain('>no-such-pool</button>')
|
|
201
|
+
expect(html).toContain('>warm</button>')
|
|
202
|
+
expect(html).toContain('Open →')
|
|
203
|
+
// Filter Claims by warm pool (return journey from Warm pools).
|
|
204
|
+
const forWarm = page(<ClaimsScreen {...screenProps(liveData())} />, `/resources/sandboxclaims?pool=${encodeURIComponent(`${NS}/warm`)}`)
|
|
205
|
+
expect(forWarm).toContain('claim-ok')
|
|
206
|
+
expect(forWarm).not.toContain('claim-missing-pool')
|
|
207
|
+
// Segment filter for Expired.
|
|
208
|
+
const expired = page(<ClaimsScreen {...screenProps(liveData())} />, '/resources/sandboxclaims?segment=expired')
|
|
209
|
+
expect(expired).toContain('claim-ok')
|
|
210
|
+
expect(expired).not.toContain('claim-missing-pool')
|
|
211
|
+
})
|
|
212
|
+
|
|
213
|
+
it('still says not found where only Radar’s read says the pool is missing', () => {
|
|
214
|
+
// The controller hasn't said why this claim waits: the column is the only place the missing pool shows.
|
|
215
|
+
const waiting = claim('waiting', { pool: 'gone-pool', reason: 'SandboxNotReady', message: 'waiting for a sandbox' })
|
|
216
|
+
const html = page(<ClaimsScreen {...screenProps(liveData({ claims: [waiting] }))} />)
|
|
217
|
+
expect(html).toMatch(/gone-pool(<\/span>)+<div[^>]*><span[^>]*>not found/)
|
|
218
|
+
})
|
|
219
|
+
|
|
220
|
+
it('says a relation it could not read is not read, never not found', () => {
|
|
221
|
+
// Warm pools read only in another namespace: the claim's pool is unread here.
|
|
222
|
+
const partial = read([], { status: 'partial', scope: { type: 'all_namespaces' }, read: { type: 'namespaces', namespaces: { count: 1, names: ['other'] } }, gaps: [{ code: 'user_forbidden', namespaces: { count: 1, names: [NS] } }] })
|
|
223
|
+
const claims = page(<ClaimsScreen {...screenProps(liveData({ warmPools: partial }))} />)
|
|
224
|
+
expect(claims).toMatch(/no-such-pool<\/span>.*?not read/)
|
|
225
|
+
expect(claims).not.toMatch(/no-such-pool(<\/span>)+<div[^>]*><span[^>]*>not found/)
|
|
226
|
+
expect(claims).toContain('>Warm pool not found<')
|
|
227
|
+
expect(page(<ClaimsScreen {...screenProps(liveData({ warmPools: DENIED }))} />)).toMatch(/no-such-pool(<\/span>)+<div[^>]*><span[^>]*>not read/)
|
|
228
|
+
// A pool's claims Radar couldn't read are unknown, not none.
|
|
229
|
+
expect(page(<WarmPoolsScreen {...screenProps(liveData({ claims: DENIED }))} />)).toMatch(/unknown/)
|
|
230
|
+
})
|
|
231
|
+
|
|
232
|
+
it('lists warm pools with ready of desired and Claims referencing / currently bound', () => {
|
|
233
|
+
const html = page(<WarmPoolsScreen {...screenProps(liveData())} />)
|
|
234
|
+
expect(html).toContain('0/2')
|
|
235
|
+
expect(html).toContain('Claims referencing')
|
|
236
|
+
expect(html).toContain('1 referencing')
|
|
237
|
+
expect(html).toContain('0 currently bound · 1 expired')
|
|
238
|
+
expect(html).toContain('Open →')
|
|
239
|
+
// Without the server saying its reserve is below target, a short pool is refilling.
|
|
240
|
+
expect(html).toContain('>Warming<')
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
it('uses Reserve below target as the warm pool verdict when the server reports reserveBelowTarget, with cause beneath', () => {
|
|
244
|
+
const server = serverReadings(liveWorkspace())
|
|
245
|
+
const html = page(<WarmPoolsScreen {...screenProps(liveData())} server={server} />)
|
|
246
|
+
expect(html).toContain('>Reserve below target<')
|
|
247
|
+
expect(html).not.toContain('>Warming<')
|
|
248
|
+
// Colored as its Needs attention row (alert, orange), the same as on the Overview.
|
|
249
|
+
expect(html).toMatch(/class="[^"]*orange[^"]*"[^>]*>Reserve below target</)
|
|
250
|
+
expect(html).toContain('Can’t schedule · All nodes have reached their Pod limit')
|
|
251
|
+
// The scheduler's own message is on hover and in the drawer, not in the row.
|
|
252
|
+
expect(html).not.toContain('Too many pods')
|
|
253
|
+
expect(html).toMatch(/<button[^>]*>Show all members that aren’t ready<\/button>/)
|
|
254
|
+
// Without the server's row there is no reason to give and nothing to count.
|
|
255
|
+
const bare = page(<WarmPoolsScreen {...screenProps(liveData())} />)
|
|
256
|
+
expect(bare).not.toContain('Pod limit')
|
|
257
|
+
expect(bare).not.toContain('not ready</button>')
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
it('narrows the Sandboxes list to one pool’s sandboxes that aren’t ready, as the pool’s link asks', () => {
|
|
261
|
+
expect(poolNotReadyPath(NS, 'warm')).toBe(`/resources/sandboxes?apiGroup=agents.x-k8s.io&pool=${encodeURIComponent(`${NS}/warm`)}&state=notReady`)
|
|
262
|
+
const all = read(liveSandboxes())
|
|
263
|
+
const names = (r: ReturnType<typeof filterSandboxes>) => (r.state === 'read' ? r.items.map((o) => o.metadata.name).sort() : [])
|
|
264
|
+
expect(names(filterSandboxes(all, `${NS}/warm`, 'notReady'))).toEqual(['warm-4xmkm', 'warm-nd2zw'])
|
|
265
|
+
expect(names(filterSandboxes(all, `${NS}/other`, 'notReady'))).toEqual([])
|
|
266
|
+
expect(filterSandboxes(all, '', '')).toBe(all)
|
|
267
|
+
const html = page(<SandboxesScreen {...screenProps(liveData())} />, `/resources/sandboxes?pool=${encodeURIComponent(`${NS}/warm`)}&state=notReady`)
|
|
268
|
+
expect(html).toContain('Warm pool: warm')
|
|
269
|
+
expect(html).toContain('Not ready')
|
|
270
|
+
expect(html).toContain('warm-4xmkm')
|
|
271
|
+
expect(html).not.toContain('bad-image')
|
|
272
|
+
const none = page(<SandboxesScreen {...screenProps(liveData())} />, `/resources/sandboxes?pool=${encodeURIComponent(`${NS}/other`)}`)
|
|
273
|
+
expect(none).toContain('No Sandboxes match these filters.')
|
|
274
|
+
})
|
|
275
|
+
|
|
276
|
+
it('applies the Resources page’s status filter, matching the text the standard table filters on', () => {
|
|
277
|
+
const suspended = page(<SandboxesScreen {...screenProps(liveData())} />, `/resources/sandboxes?filters=${encodeURIComponent('status:Suspended')}`)
|
|
278
|
+
expect(suspended).toContain('Status: Suspended')
|
|
279
|
+
const shown = liveSandboxes().map((o) => o.metadata.name).filter((n) => suspended.includes(`>${n}<`))
|
|
280
|
+
expect(shown).toEqual(liveSandboxes().filter((o) => getSandboxStatus(o).text === 'Suspended').map((o) => o.metadata.name))
|
|
281
|
+
expect(shown).toEqual(['suspended'])
|
|
282
|
+
const excluded = page(<SandboxesScreen {...screenProps(liveData())} />, `/resources/sandboxes?filters=${encodeURIComponent('status:exclude:Suspended')}`)
|
|
283
|
+
expect(excluded).toContain('Status excludes: Suspended')
|
|
284
|
+
expect(excluded).toContain('>foreign<')
|
|
285
|
+
expect(excluded).not.toContain('>suspended<')
|
|
286
|
+
|
|
287
|
+
const claimText = getSandboxClaimStatus(liveClaims()[0]).text
|
|
288
|
+
const claims = page(<ClaimsScreen {...screenProps(liveData())} />, `/resources/sandboxclaims?filters=${encodeURIComponent(`status:${claimText}`)}`)
|
|
289
|
+
expect(claims).toContain('claim-missing-pool')
|
|
290
|
+
expect(claims).not.toContain('claim-ok')
|
|
291
|
+
const cold = warmPool('cold', { uid: 'a' })
|
|
292
|
+
const full = warmPool('full', { uid: 'b', readyReplicas: 2 })
|
|
293
|
+
const pools = liveData({ warmPools: [cold, full] })
|
|
294
|
+
const fullText = getSandboxWarmPoolStatus(full).text
|
|
295
|
+
expect(fullText).not.toBe(getSandboxWarmPoolStatus(cold).text)
|
|
296
|
+
const poolsHtml = page(<WarmPoolsScreen {...screenProps(pools)} />, `/resources/sandboxwarmpools?filters=${encodeURIComponent(`status:${fullText}`)}`)
|
|
297
|
+
expect(poolsHtml).toContain('>full<')
|
|
298
|
+
expect(poolsHtml).not.toContain('>cold<')
|
|
299
|
+
expect(page(<WarmPoolsScreen {...screenProps(pools)} />, `/resources/sandboxwarmpools?filters=${encodeURIComponent('status:Nope')}`)).toContain('No SandboxWarmPools match these filters.')
|
|
300
|
+
})
|
|
301
|
+
|
|
302
|
+
it('names the Resources filters these lists can’t apply instead of dropping them', () => {
|
|
303
|
+
const search = `?filters=${encodeURIComponent('status:Suspended|label%3Atier:gold')}&labels=app%3Dx&ownerKind=Deployment&ownerName=web`
|
|
304
|
+
const { columns, ignored } = readListFilters(search, SANDBOX_KIND)
|
|
305
|
+
expect(columns).toEqual([{ key: 'status', label: 'Status', values: ['Suspended'], exclude: false }])
|
|
306
|
+
expect(ignored.map((f) => f.label)).toEqual(['label:tier: gold', 'Labels: app=x', 'Owner: Deployment/web'])
|
|
307
|
+
const html = page(<SandboxesScreen {...screenProps(liveData())} />, `/resources/sandboxes${search}`)
|
|
308
|
+
expect(html).toContain('Labels: app=x (not applied here)')
|
|
309
|
+
expect(html).toContain('Owner: Deployment/web (not applied here)')
|
|
310
|
+
// Clearing one column keeps the others.
|
|
311
|
+
expect(withoutColumn(search, 'status').get('filters')).toBe('label%3Atier:gold')
|
|
312
|
+
expect(withoutColumn(`?filters=status:Suspended`, 'status').has('filters')).toBe(false)
|
|
313
|
+
})
|
|
314
|
+
|
|
315
|
+
it('narrows each list by name from the Resources page’s search param', () => {
|
|
316
|
+
const sandboxes = page(<SandboxesScreen {...screenProps(liveData())} />, '/resources/sandboxes?search=BAD')
|
|
317
|
+
expect(sandboxes).toContain('bad-image')
|
|
318
|
+
expect(sandboxes).not.toContain('foreign')
|
|
319
|
+
expect(page(<SandboxesScreen {...screenProps(liveData())} />, '/resources/sandboxes?search=nothing-here')).toContain('No Sandboxes match this search.')
|
|
320
|
+
const claims = page(<ClaimsScreen {...screenProps(liveData())} />, '/resources/sandboxclaims?search=ok')
|
|
321
|
+
expect(claims).toContain('claim-ok')
|
|
322
|
+
expect(claims).not.toContain('claim-missing-pool')
|
|
323
|
+
expect(page(<ClaimsScreen {...screenProps(liveData())} />, '/resources/sandboxclaims?search=nothing-here')).toContain('No SandboxClaims match this search.')
|
|
324
|
+
const data = liveData({ warmPools: [warmPool('alpha', { uid: 'a' }), warmPool('beta', { uid: 'b' })] })
|
|
325
|
+
const pools = page(<WarmPoolsScreen {...screenProps(data)} />, '/resources/sandboxwarmpools?search=alp')
|
|
326
|
+
expect(pools).toContain('alpha')
|
|
327
|
+
expect(pools).not.toContain('beta')
|
|
328
|
+
expect(page(<WarmPoolsScreen {...screenProps(data)} />, '/resources/sandboxwarmpools?search=nothing-here')).toContain('No SandboxWarmPools match this search.')
|
|
329
|
+
// The box shows the search it applies.
|
|
330
|
+
expect(sandboxes).toMatch(/value="BAD"/)
|
|
331
|
+
})
|
|
332
|
+
|
|
333
|
+
it('colors a row as the server’s Needs attention row about it, so a state reads the same on the Overview', () => {
|
|
334
|
+
// A claim that can't bind is a warning in the reading, the row and Issues alike.
|
|
335
|
+
const claims = page(<ClaimsScreen {...screenProps(liveData())} server={serverReadings(liveWorkspace())} />)
|
|
336
|
+
expect(claims).toMatch(/class="[^"]*amber[^"]*"[^>]*>Warm pool not found</)
|
|
337
|
+
expect(page(<ClaimsScreen {...screenProps(liveData())} />)).toMatch(/class="[^"]*amber[^"]*"[^>]*>Warm pool not found</)
|
|
338
|
+
const slow = sandbox('slow', { conditions: [
|
|
339
|
+
{ type: 'Ready', status: 'False', reason: 'DependenciesNotReady' },
|
|
340
|
+
{ type: 'PodScheduled', status: 'False', reason: 'Unschedulable' },
|
|
341
|
+
] })
|
|
342
|
+
const attention = [{
|
|
343
|
+
id: 'sandbox:slow', category: 'sandbox', rule: 'stalled', severity: 'warning', issue: true,
|
|
344
|
+
subject: { kind: 'Sandbox', group: 'agents.x-k8s.io', name: 'slow', namespace: NS },
|
|
345
|
+
title: 'Pod can’t be scheduled', nextStep: 'Check the scheduler',
|
|
346
|
+
}] as const
|
|
347
|
+
const data = liveData({ sandboxes: [slow] })
|
|
348
|
+
const server = serverReadings(liveWorkspace({ attention: [...attention] }))
|
|
349
|
+
expect(page(<SandboxesScreen {...screenProps(data)} server={server} />)).toMatch(/class="[^"]*amber[^"]*"[^>]*>Can’t schedule</)
|
|
350
|
+
})
|
|
351
|
+
|
|
352
|
+
it('says what an empty owner, expiry, warm pool or template means, and only where Radar knows', () => {
|
|
353
|
+
// No owner and every claim here read: standalone. No shutdownTime: no expiry.
|
|
354
|
+
const sandboxes = page(<SandboxesScreen {...screenProps(liveData())} />)
|
|
355
|
+
const badImage = sandboxes.slice(sandboxes.indexOf('>bad-image<'), sandboxes.indexOf('</tr>', sandboxes.indexOf('>bad-image<')))
|
|
356
|
+
expect(badImage).toContain('standalone')
|
|
357
|
+
expect(badImage).toContain('no expiry')
|
|
358
|
+
expect(badImage).not.toContain('>–<')
|
|
359
|
+
// Claims not read: no warm pool owns it, and a claim may still name it.
|
|
360
|
+
const unread = page(<SandboxesScreen {...screenProps(liveData({ claims: DENIED }))} />)
|
|
361
|
+
expect(unread).toContain('no warm pool; claims not read')
|
|
362
|
+
expect(unread).not.toContain('standalone')
|
|
363
|
+
// A claimed Sandbox with no shutdownTime of its own may still end with its claim.
|
|
364
|
+
const claimOwner = [{ apiVersion: 'extensions.agents.x-k8s.io/v1beta1', kind: 'SandboxClaim', name: 'c', uid: 'u', controller: true }]
|
|
365
|
+
const claimed = page(<SandboxesScreen {...screenProps(liveData({ sandboxes: [sandbox('claimed', { ownerReferences: claimOwner })] }))} />)
|
|
366
|
+
expect(claimed).toContain('none of its own')
|
|
367
|
+
expect(claimed).not.toContain('no expiry')
|
|
368
|
+
// Another kind owns it: named, not called standalone.
|
|
369
|
+
const deploy = [{ apiVersion: 'apps/v1', kind: 'Deployment', name: 'runner', uid: 'u', controller: true }]
|
|
370
|
+
const other = page(<SandboxesScreen {...screenProps(liveData({ sandboxes: [sandbox('owned', { ownerReferences: deploy })] }))} />)
|
|
371
|
+
expect(other).toContain('>runner<')
|
|
372
|
+
expect(other).toContain('Deployment')
|
|
373
|
+
expect(other).not.toContain('standalone')
|
|
374
|
+
|
|
375
|
+
const noPool = claim('direct')
|
|
376
|
+
delete noPool.spec.warmPoolRef
|
|
377
|
+
expect(page(<ClaimsScreen {...screenProps(liveData({ claims: [noPool] }))} />)).toContain('no warm pool')
|
|
378
|
+
const bare = warmPoolWithoutTemplate()
|
|
379
|
+
expect(page(<WarmPoolsScreen {...screenProps(liveData({ warmPools: [bare] }))} />)).toContain('no template')
|
|
380
|
+
})
|
|
381
|
+
|
|
382
|
+
it('says an empty list is unknown and names the missing permission when denied', () => {
|
|
383
|
+
expect(page(<SandboxesScreen {...screenProps(liveData({ sandboxes: DENIED }))} />)).toContain('Unknown: no access to Sandboxes (missing list sandboxes.agents.x-k8s.io).')
|
|
384
|
+
expect(page(<ClaimsScreen {...screenProps(emptyData())} />)).toContain('No SandboxClaims found in the requested scope.')
|
|
385
|
+
expect(page(<WarmPoolsScreen {...screenProps(emptyData({ warmPools: read([], PARTIAL) }))} />)).toContain('No SandboxWarmPools found in the namespaces Radar could read.')
|
|
386
|
+
})
|
|
387
|
+
})
|
|
388
|
+
|
|
389
|
+
describe('Agent Sandbox list queries', () => {
|
|
390
|
+
it('are refreshed by what refreshes resource lists: writes, and live events for their kind', () => {
|
|
391
|
+
for (const kind of [SANDBOX_KIND, SANDBOX_CLAIM_KIND, SANDBOX_WARM_POOL_KIND]) {
|
|
392
|
+
const client = new QueryClient()
|
|
393
|
+
const key = agentSandboxListKey(kind, NS)
|
|
394
|
+
const stale = () => client.getQueryState(key)?.isInvalidated
|
|
395
|
+
client.setQueryData(key, { items: [], coverage: { status: 'unknown' } })
|
|
396
|
+
// A live event invalidates ['resources', plural], the plural the event's kind and group map to.
|
|
397
|
+
void client.invalidateQueries({ queryKey: ['resources', kindToPluralWithGroup(kind.kind, kind.group)] })
|
|
398
|
+
expect(stale()).toBe(true)
|
|
399
|
+
client.setQueryData(key, { items: [], coverage: { status: 'unknown' } })
|
|
400
|
+
void client.invalidateQueries({ queryKey: ['resources'] })
|
|
401
|
+
expect(stale()).toBe(true)
|
|
402
|
+
// Another kind's event leaves it alone.
|
|
403
|
+
client.setQueryData(key, { items: [], coverage: { status: 'unknown' } })
|
|
404
|
+
void client.invalidateQueries({ queryKey: ['resources', 'pods'] })
|
|
405
|
+
expect(stale()).toBe(false)
|
|
406
|
+
// The standard list's key for the same kind (group in the third place) is a different entry.
|
|
407
|
+
expect(client.getQueryData(['resources', kind.name, kind.group, [NS]])).toBeUndefined()
|
|
408
|
+
}
|
|
409
|
+
})
|
|
410
|
+
})
|