support a network config overlay file#1903
Draft
stefanpenner wants to merge 1 commit into
Draft
Conversation
Deep-merge an optional ~/.router/config/network_config_overlay.json onto the active config on apply and in /config/active, stripped before persisting to sysdb:networkConfig. Lets an admin add interfaces that survive app re-push and reboots without mutating the app-owned config. Mirrors routeConfig.json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ac83e46 to
c4a9f58
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.
Part of a 2-PR stack: #1902 vxlan interface plugin · #1903 (this) network config overlay. Independent; better together.
Why
The app owns the entire
sysdb:networkConfig, so there is no supported way to add your own interface that survives the app rewriting that config — or a reboot. An admin-defined vxlan LAN, for example, is dropped on the next app change.How
Adds an optional
~/.router/config/network_config_overlay.json. It is deep-merged onto the active config when applying (tryApplyConfig) and when serving/config/active, and stripped back out insaveConfig— so it is never written intosysdb:networkConfig. The app's own config is therefore never touched: delete the file and the next apply reverts it; absent, it does nothing. Mirrors how the system config already overlaysrouteConfig.json(util/config.js).{ "interface": { "vxlan": { "vxlan99": { "enabled": true, "meta": { "type": "lan", "name": "exp" }, "vni": 99, "intf": "br0", "local": "10.86.1.1", "remote": "10.86.1.32", "ipv4": "10.99.0.1/24" } } }, "dhcp": { "vxlan99": { "gateway": "10.99.0.1", "subnetMask": "255.255.255.0", "range": { "from": "10.99.0.100", "to": "10.99.0.200" } } } }