Repository navigation
refactor(deploy): consolidate per-daemon snmp-config.xml into shared overlay - #397
Merged
Merged
Conversation
…overlay The SNMP peer configuration was duplicated across all five SNMP-consuming daemon overlays (collectd, pollerd, provisiond, enlinkd, perspectivepollerd), forcing every community-string/definition change to be applied five times. Establish a single committed source at deploy/overlays/shared/etc/snmp-config.xml and fan it out at image-build time via a new stage_shared_snmp_config() in tools/build.sh, mirroring the existing stage_shared_poller_catalog() mechanism; the generated per-daemon copies are now git-ignored. Make build.sh sourceable (BASH_SOURCE guards around version resolution and main) so a drift-guard test (tools/stage-shared-snmp-config.test.sh) can exercise the real staging function. No runtime change: each daemon still loads its local etc/snmp-config.xml at boot. Verified via full `make images` + `make up PROFILE=full` — all five images carry the byte-identical staged config and the daemons log loading it from /opt/deltav/etc/snmp-config.xml. Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: Ronny Trommer <ronny@no42.org>
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.
What
Consolidate the SNMP peer configuration that was duplicated across all five SNMP-consuming daemon overlays (
collectd,pollerd,provisiond,enlinkd,perspectivepollerd) into a single committed source of truth.deploy/overlays/shared/etc/snmp-config.xml(the one committed copy).deploy/overlays/<daemon>/etc/snmp-config.xmlcopies; now git-ignored generated artifacts.tools/build.sh: newstage_shared_snmp_config()fans the shared file into each consumer overlay at image-build time, wired into both the full-build (do_deltav_images) and single-daemon (do_single_daemon_image) paths — mirroring the existingstage_shared_poller_catalog()mechanism.build.shis made sourceable (BASH_SOURCEguards around version resolution andmain) so a test can exercise the real staging function.tools/stage-shared-snmp-config.test.sh— drift guard asserting the staged copies are byte-identical to the shared source (idempotency + fail-fast covered).Why
Every community-string/definition change previously had to be applied five times by hand — a maintenance liability and a single-source-of-truth violation.
Behavior / compatibility
No runtime change: each daemon still loads its local
etc/snmp-config.xmlat boot via the unchangedsnmpPeerFactorybean. Note:collectdandenlinkdpreviously lacked a trailing newline; the canonical source adopts the newline-terminated variant — a runtime-inert normalization (XML element is identical).Verification
shellcheckclean;tools/stage-shared-snmp-config.test.sh→ 8/8 pass.make images(build.sh deltav): staging fired for all 5 consumers; all 5 daemon images built with the stagedsnmp-config.xmlbaked in at/opt/deltav/etc/snmp-config.xml, byte-identical to the shared source (md5 match).make up PROFILE=fullboot smoke: all 5 daemons loadSnmpPeerFactory from /opt/deltav/etc/snmp-config.xmland start healthy.Follow-up
Non-blocking hardening tracked in #396 (run the shell drift-guard tests in CI; add a build-time guard ensuring
snmp-config.xmlis staged, parallel to the pollerCatalogLint).🤖 Generated with Claude Code