[settings-naming] rename resourceMonitor -> resourceMonitor.enabled (D2) - #1016
Conversation
RFC-0076 S14 (client#1009). `resourceMonitor: <bool>` becomes
`resourceMonitor.enabled: <bool>` (D2: component booleans are
`<component>.enabled`).
This is a bool->object change, so every stored values.yaml and every
`--set resourceMonitor=true` still arrives as a SCALAR. A template that
read `.Values.resourceMonitor.enabled` blindly would `fail`
("can't evaluate field enabled in interface {}") on the scalar, and the
old `ne .Values.resourceMonitor false` gate crashes
("incompatible types for comparison: map and bool") on the new object.
So all reads now route through a single new helper,
tracebloc.resourceMonitorEnabled, which resolves the effective flag from
whichever shape is present (kindIs), preferring the new `.enabled` form
and defaulting absent/`{}` to enabled to match the historical default.
Effective behaviour is unchanged: resourceMonitor.enabled=true does
exactly what resourceMonitor=true did.
- values.yaml default is now the object form; legacy scalar still honoured
through the alias window (remove_by: 2026-12-31).
- values.schema.json accepts both a boolean and an object; the object
CLOSES its keys (additionalProperties: false) so a mistyped `enabled`
is refused at chart load instead of silently staying enabled.
- migrated the eight readers (daemonset, rbac, scc, secrets, rbac.yaml,
jobs-manager NODE_AGENTS_NAMESPACE, NOTES.txt, and the two _helpers
predicates resourceMonitorRefreshPinned / nodeAgentsInUse).
- Chart.yaml version+appVersion bumped 1.9.107 -> 1.9.108 (chart-version-guard).
- helm-unittest: added legacy-scalar, new-object, unset, null, `{}`,
both-disabled, and mistyped-key cases.
Closes #1009
Part of tracebloc/backend#3391
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…sourcemonitor-enabled
…-guard) — client#1009 Develop advanced to 1.9.108 after this branch bumped there too; re-bump so the version stays above develop. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
saqlainsyed007
left a comment
There was a problem hiding this comment.
Approve. Clean D2 rename: resourceMonitor (scalar) → resourceMonitor.enabled (object) routed through a single tracebloc.resourceMonitorEnabled helper that coalesces both shapes for the alias window. All eight gates converted, no dangling old-name reads, schema accepts the legacy scalar and rejects mistyped sub-keys, and the new tests cover scalar/object/null/{}/mistyped-key. Behavior-preserving, green CI, no conflicts.
saadqbal
left a comment
There was a problem hiding this comment.
The bool→object shim is the right shape here — single helper, kindIs on both directions, schema accepting either type with the object's keys closed. I ran it locally rather than take the description's word for it: legacy scalar, new object, unset, null and {} all render as documented, the mistyped enable: key is refused at load, and a values-file resourceMonitor: false still wins over the new map default (only the collector DaemonSet survives). 703/703 unittests, lint green on all four platform files. Catching that NOTES.txt was crashing in the other direction — comparing a map to a bool — was the good find.
Two doc leftovers, neither blocking. The daemonset's preflight fail now tells operators resourceMonitor.enabled: false and points them at SECURITY.md — but docs/SECURITY.md:103 still says resourceMonitor: false, so the error message and the doc it cites disagree. And docs/migration-tools/generate.sh:124 still emits the legacy scalar into every values file it generates, which means fresh legacy configs keep getting minted right up to the remove_by date. Worth fixing both while the context is fresh.
Heads up that #1008 also bumps Chart.yaml to 1.9.109 — whoever lands second gets a conflict. No functional overlap though; it never reads resourceMonitor directly.
…sourcemonitor-enabled # Conflicts: # client/Chart.yaml
dbbc917
|
Rebased onto develop (it had advanced +18 commits while this sat). The only change since your approval is the develop merge + a Chart.yaml re-bump to — drafted with Claude Code |
saqlainsyed007
left a comment
There was a problem hiding this comment.
Approving. This is a complete, backward-compatible settings rename and the tests cover the full alias-window matrix. CI green, mergeable, no open threads.
Helper is correct. tracebloc.resourceMonitorEnabled coalesces every value shape by kindIs: map → dig "enabled" true $rm (object form, absent .enabled defaults to true), invalid/nil → "true" (the historical absent-is-enabled default), bool scalar → ne $rm false. Both crash directions it exists to prevent are real — a blind ne .Values.resourceMonitor false fails "incompatible types map and bool" on the object, and a blind .Values.resourceMonitor.enabled fails "can't evaluate field enabled in interface {}" on the legacy scalar.
Migration is total. Every gate moved to the helper: the eight ne .Values.resourceMonitor false sites → (include ...), and resourceMonitorRefreshPinned's eq ... false → not (include ...) — the negation is preserved (pinned-when-disabled still holds). Fail message and the SECURITY comment now name resourceMonitor.enabled: false.
Schema tightening is a real gain, not just a rename. resourceMonitor becomes ["boolean","object"] with additionalProperties: false, so a mistyped enable/disabled is refused at chart load instead of silently dig-defaulting back to true and turning the monitor on — a misconfiguration surface the scalar had no sub-key to expose.
Tests hold the bar. The matrix pins legacy scalar true/false, object enabled true/false, unset default, null (--reuse-values from a pre-key chart), {} (object with .enabled absent → default true), and the mistyped-key → failedTemplate. Each renders/refuses through the real template, so a helper regression on any shape reddens. The bare failedTemplate: {} with its note on the 0.5.2 errorPattern limitation (backend#2606) is the right call given the tooling. I'd own this.
saqlainsyed007
left a comment
There was a problem hiding this comment.
Re-reviewed at dbbc917. Confirmed every runtime reader of .Values.resourceMonitor now routes through the single tracebloc.resourceMonitorEnabled helper — grep at head shows the only bare .Values.resourceMonitor read left is inside the helper itself (line 155); the other occurrences are comments. The helper correctly coalesces all three shapes (map via dig "enabled" true, invalid/nil → enabled, scalar bool), the schema accepts both forms with additionalProperties: false closing the object, and the unit tests cover legacy scalar / object / null / {} / mistyped-key. CI is fully green (Cursor Bugbot, bugbot / review, Source-of-truth drift, all Template renders, Helm unit tests) with no open threads. LGTM.
Non-blocking nit: the PR body says Chart.yaml bumped 1.9.107 -> 1.9.108, but head actually bumps 1.9.115 -> 1.9.116 — stale description text from re-pushes; the file itself is consistent and version-bump-gate passes.
What
RFC-0076 S14. Renames the Helm value
resourceMonitor: <bool>toresourceMonitor.enabled: <bool>, following the D2 convention that component booleans are<component>.enabled.Closes #1009
Part of tracebloc/backend#3391
The breaking-change hotspot, and how it's avoided
This is a bool -> object change. An existing customer
values.yaml, a persisted values file, or a bare--set resourceMonitor=truestill supplies a scalar. Two crashes are possible during the alias window, in opposite directions:.Values.resourceMonitor.enabledblindlyfails "can't evaluate field enabled in interface {}" on the legacy scalar; andne .Values.resourceMonitor falsegate crashes "incompatible types for comparison: map and bool" on the new object (this actually bitNOTES.txt, which the earlier grep missed).So every reader now routes through one new helper,
tracebloc.resourceMonitorEnabled, which resolves the effective flag from whichever shape is present:resourceMonitor: true/false(legacy scalar)resourceMonitor.enabled: true/false(new object).enabledresourceMonitor: {}(object,.enabledabsent)null(--reuse-valuesfrom a pre-key chart)It picks the shape with
kindIsand prefers the new.enabledform. Effective behaviour is unchanged —resourceMonitor.enabled=truedoes exactly whatresourceMonitor=truedid. Emits"true"/"", so callers use it inand/orandnot (include ...)for the disabled case, the same idiom astracebloc.nodeAgentsInUse.Values-file merges were the subtle case: helm's
-fcoalescing differs from--set, but the user's scalar still wins over the new map default (verified an operator'sresourceMonitor: falsefrom a values file still disables the DaemonSet). The only artifact is a benigncannot overwrite table with non tablecoalesce info log when a legacy scalar meets the map default; lint stays green.Schema
values.schema.jsonnow accepts both a boolean and an object, so the legacy scalar is never rejected. The object form closes its keys (additionalProperties: false) so a mistypedenabled(e.g.enable:) is refused loudly at chart load instead of silentlydig-defaulting back totrueand turning the monitor back on — same reasoning this schema already applies tochannelTags.Readers migrated (8)
resource-monitor-daemonset.yaml,resource-monitor-rbac.yaml,resource-monitor-scc.yaml,secrets.yaml(cross-namespace mirror),rbac.yaml(node-agents Role),jobs-manager-deployment.yaml(NODE_AGENTS_NAMESPACEenv),NOTES.txt, and the two_helpers.tplpredicatesresourceMonitorRefreshPinned/nodeAgentsInUse. Out of scope and untouched:images.resourceMonitor.digest(a separate image-config map).Verification
helm lint --strictgreen across all four platform values files.helm templaterenders correctly for legacy scalar (true/false), new object (enabled: true/false), unset,null, and{}; the mistyped-key case is refused by the schema.helm unittest ./client: 703 pass. Added cases totests/resource_monitor_test.yamlfor legacy scalar, new object, unset default,null,{}, both disabled shapes, and the mistyped-key schema rejection.Chart.yamlversion+appVersionbumped1.9.107 -> 1.9.108(required by chart-version-guard); guard verified passing locally.— drafted with Claude Code
🤖 Generated with Claude Code
Note
Medium Risk
Bool-to-object Helm value changes can mis-gate the resource-monitor DaemonSet on upgrade if alias logic is wrong; behavior is intended to stay identical when legacy scalars or
--set resourceMonitor=true|falseare used.Overview
Renames the Helm value
resourceMonitor: <bool>toresourceMonitor.enabled: <bool>(RFC-0076 D2) and bumps the chart to 1.9.116.To avoid breaking upgrades, a new
tracebloc.resourceMonitorEnabledhelper is the single gate: it accepts the legacy scalar, the new object (defaulting missing.enabledto on), and unset/null the same way as before. DaemonSet/RBAC/SCC/secrets, jobs-managerNODE_AGENTS_NAMESPACE, post-install NOTES, andresourceMonitorRefreshPinned/nodeAgentsInUsenow call that helper instead of comparing.Values.resourceMonitordirectly.values.yamldefaults to the object form;values.schema.jsonallows boolean or object (closed keys so typos likeenable:fail at load). Helm unittest cases cover both value shapes and disabled paths.Reviewed by Cursor Bugbot for commit dbbc917. Bugbot is set up for automated code reviews on this repo. Configure here.