fix(config): deep-merge extraConfig and reject reserved paths - #6
Merged
Conversation
tdakkota
force-pushed
the
fix/extraconfig-deep-merge
branch
from
July 28, 2026 11:39
13e90a0 to
894f9fa
Compare
extraConfig was merged with maps.Copy, so any extraConfig mentioning storage replaced the whole generated storage block: backend fell back to memory, the cluster block vanished, and the node silently lost durability and ring membership. Merge recursively instead, and reject extraConfig that targets paths the operator renders itself (signal backends, storage.backend/dir/wal_dir/s3, storage.cluster and the engine tuning keys). Invalid specs now surface as Degraded/InvalidSpec on the CR without being requeued. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tdakkota
force-pushed
the
fix/extraconfig-deep-merge
branch
from
July 28, 2026 11:51
894f9fa to
7e6b5ae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
renderConfigmergedspec.extraConfigover the generated config withmaps.Copy(cfg, extra)— ashallow, top-level copy. Because the operator renders everything that matters under a single
storagekey, anyextraConfigthat mentionsstoragediscarded the whole generated block:backend,dir,cluster.etcd/rf/shards_per_tenant,s3and the engine tuning.Impact
Silent, and in the worst direction: an absent
backenddefaults to the ephemeral memorybackend (the PVC is mounted and unused, data is lost on restart) and an absent
clusterblock meansthe node leaves the cluster (no etcd, no ring, no replication). Nothing flagged it — both
configs are legal on their own.
The fix
extraConfigis merged recursively: nested objects merge key by key, everythingelse (scalars, lists, explicit nulls) replaces.
extraConfig: {storage: {policy: ...}}now addsstorage.policyand keepsbackend,dirandcluster.extraConfigoverwrite
storage.cluster.etcdorstorage.backend, so the paths the operator renders from thespec are reserved: the signal backends,
storage.backend/dir/wal_dir/s3, the wholestorage.clustersubtree, and thestorage.*engine tuning keys. Setting one fails the reconcilewith an error naming the offending path and the spec field to use instead.
extraConfig, missingetcd.endpoints, missing S3 bucket) are wrapped in avalidationErrorandsurface as
Degradedwith reasonInvalidSpec, and are not requeued — retrying cannot fix them,a spec change re-triggers reconcile.
Docs: the
extraConfigfield godoc, the regenerated CRD and a README table of reserved paths.Tests
Table tests for
deepMergeandvalidateExtraConfig, plusrenderConfigregressions assertingthat
extraConfig: {storage: {policy: ...}}preservesbackend/dir/clusterand that a reservedpath fails validation.
make testandmake lintpass.Closes #1
🤖 Generated with Claude Code