[settings-naming] rename resourceMonitor -> resourceMonitor.enabled (D2) - #1016
[settings-naming] rename resourceMonitor -> resourceMonitor.enabled (D2)#1016aptracebloc wants to merge 3 commits into
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.
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
Touches many install gates (DaemonSet, RBAC, secrets, jobs-manager env) for a widely enabled component; mitigated by a centralized helper and broad unittest coverage, but wrong coalescing during upgrades could still mis-toggle the monitor.
Overview
RFC-0076 (D2): The Helm value moves from scalar
resourceMonitor: <bool>toresourceMonitor.enabled: <bool>, with chart 1.9.109 and defaults/schema updated accordingly.Because that is a bool→object rename, upgrades can still supply a legacy scalar (
values.yaml,--set resourceMonitor=true,--reuse-values). The PR addstracebloc.resourceMonitorEnabledas the single gate: it useskindIsto accept legacy bool, new{ enabled: … }(defaulting missingenabledto on), and absent/null as historically enabled—avoiding template failures from comparing map vs bool or reading.enabledon a scalar.All DaemonSet-related rendering (DaemonSet, RBAC, SCC, cross-namespace secret mirror, node-agents Role, jobs-manager
NODE_AGENTS_NAMESPACE, NOTES, image-refresh /nodeAgentsInUsehelpers) now calls that helper instead ofne .Values.resourceMonitor false. Schema allows boolean or object (object keys closed so typos likeenable:fail at load). helm-unittest cases cover legacy/new/disabled shapes and schema rejection.Effective on/off behavior is unchanged when values are expressed correctly; operators should prefer
resourceMonitor.enabledduring the alias window (remove_by 2026-12-31).Reviewed by Cursor Bugbot for commit dc8ce41. Bugbot is set up for automated code reviews on this repo. Configure here.