Store device FIB for observability (no rule limiting)
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful

Devices carry a reachable_prefixes set (migration 0004) reported by their agent
from the kernel FIB, via a new agent-authed POST /devices/{name}/routes endpoint.
This is scoping/observability data, so it does not bump the config generation and
is exposed on the device resource.

It deliberately does NOT limit which rules a device enforces: the compiler still
emits every applicable rule on every enforcing device. The interface-agnostic,
address-matched rule form is correct under ECMP precisely because it does not
depend on which device is on the path, and most routers hold a default route
anyway — so reachability could not meaningfully narrow the rule set. The reported
FIB is kept for fleet visibility and future zone-origin validation.
This commit is contained in:
benvin
2026-07-20 22:35:28 +10:00
committed by Ben Vincent
parent b350c8d198
commit 9dbeb62414
7 changed files with 85 additions and 3 deletions
+4
View File
@@ -131,6 +131,10 @@ func Render(in Input) (*RenderedConfig, error) {
usedSets := map[string]model.AddressGroup{}
// Every enforcing device carries every applicable rule: the interface-agnostic
// address-matched form is correct under ECMP precisely because it does not
// depend on which device is on the path (over-approximation is safe). Reported
// FIBs are stored for observability/validation, not to limit rules.
if out.Enforcing {
for _, rule := range in.Rules {
rr, err := renderRule(in, rule, usedSets)