libs/dyn/merge: clear an inherited value when an override is null#5949
libs/dyn/merge: clear an inherited value when an override is null#5949apoorva-01 wants to merge 1 commit into
Conversation
A null in a target (e.g. autoscale: null) was treated as "no value" and ignored, so there was no way to drop a field inherited from the base.
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Approval status: pending
|
Changes
An explicit
nullin an override now clears the inherited value instead of being ignored, soautoscale: nullin a target actually drops the base autoscale block.I kept it scoped to map entries in
merge.Merge(key present + incoming nil = clear). Absent keys aren't affected and top-levelMerge(x, nil) == xstill holds. The tidier alternative is making nil always win inmerge()itself, but that flips a documented invariant three tests assert, and touches every caller. Happy to go that way if you'd rather.Why
Closes #5701. There's currently no way to drop an inherited field in a target, so you can't switch a job cluster to single-node for just one target.
Tests
Unit test for a null override clearing an existing entry (checks value and locations), plus a
no_autoscaletarget in theoverride/clustersacceptance test. Both fail without the fix.