Repository navigation
Show the Pod/template comparison in resource drawers - #2198
nadaverell wants to merge 10 commits into
Conversation
PR Summary by QodoShow Pod/template differences in resource drawers
AI Description
Diagram
High-Level Assessment
Files changed (15)
|
Code Review by Qodo
1. Early resource views omit comparisons
|
5ccc6c3 to
f457b11
Compare
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
1 similar comment
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
723b3c1 to
ee87e94
Compare
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
ee87e94 to
e64b66e
Compare
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
# Fix data race in the helm target-namespace test server `targetNamespaceActionConfig` (added in #2080) starts an `httptest` server whose handler reads and writes a shared `objects` map and appends to a `writes` slice. The kube client sends requests concurrently, so `go test` sometimes died with `fatal error: concurrent map read and map write`, as in the Backend job on #2198. The handler now holds a `sync.Mutex` while it touches that state. Only the test changes. **Verification** (`go test -race -count=20 ./internal/helm -run TargetNamespace`): - Before: FAIL, with 3 `WARNING: DATA RACE` reports. - After: `ok` (20.2s), no race reports.
Why
#2154 added
templateDivergence: how a Pod's live spec differs from the template that created it, plus the objects that could have changed it. Until now only MCP agents saw it. Someone opening a Pod or Deployment in Radar saw the 16Mi limit and nothing saying the template asked for 256Mi.What changes
/api/resources/{kind}/{namespace}/{name}returns an optionaltemplateDivergencefor Pods, ReplicaSets, Deployments and Jobs. It is the same comparison, computed as the caller, that MCPget_resourcereturns. It is omitted when nothing differs.memory limit 16Mi (template 256Mi) · +1 more · 4 possible sources. The header is a button witharia-expanded. Opened, the card has:An opened card stays open for that resource for the rest of the browser session. The agent-facing sentences stay out of it.
TemplateDivergencegains structuredsourceRefs(with each candidate's creation time),sourceGapsandsourcesNotNamedso the card can link objects instead of parsing prose.Screenshots
Captured on an EKS test cluster, with a webhook rewriting memory to 16Mi and a namespace LimitRange.
Deployment drawer, collapsed (light and dark):
Opened: the Deployment card, and the LimitRange case (dark):
Clicking a candidate opens it; for example, the webhook opens the MutatingWebhookConfiguration drawer.
Tests
aria-expandedand the open state persists only for the same resource;+N moreand gaps all render;sourceRefsandsourceGaps.Known limits
A Deployment's open drawer refreshes its comparison when the Deployment, its ReplicaSet or its status changes. An edit made only to a Pod (rare: a direct image edit or a completed in-place resize) shows on the next refresh.
The candidate list does not mark control-plane loopback webhooks. They are still listed last.
The Diagnose pane's
context=nonecard tone (from Show admission mutations: name every webhook candidate, Pod/template differences without an issue, webhook changes in namespace views #2154) is unchanged here.Possible follow-up