Skip to content

refactor: Remove router mode concept from galactic-router - #418

Merged
privateip merged 1 commit into
mainfrom
refactor/router-417-remove-mode-concept
Aug 16, 2026
Merged

refactor: Remove router mode concept from galactic-router#418
privateip merged 1 commit into
mainfrom
refactor/router-417-remove-mode-concept

Conversation

@privateip

Copy link
Copy Markdown
Contributor

Summary

galactic-router accepted three operating modes, but only one ever worked — the other two were a stub that always failed and a value rejected at startup. Every real deployment already hardcoded the working mode, and the tenant/route-reflector split it's actually used for has always come from a separate flag, independent of mode. This removes the mode concept entirely: the router is now GoBGP-only, with no mode flag, env var, or stub backend to maintain.

Test plan

  • Unit, lint, and e2e suites pass
  • A live multi-cluster lab deploy converges identically (BGP sessions, EVPN routes, gateway canary, cross-site ping) with the mode-free build
  • A non-tenant-role router is still safely skipped rather than reconciled, now covered by a new test

Fixes #417

@privateip
privateip requested a review from a team as a code owner August 16, 2026 15:08
ecv
ecv previously approved these changes Aug 16, 2026
`galactic-router` accepted --mode=transit/fabric/tenant, but only tenant
ever worked: fabric was a 42-line stub returning "not implemented" for
every method, and transit was rejected at startup with a hard error.
Every real manifest already hardcoded --mode=tenant, and the
tenant/route-reflector split has always been carried entirely by
--reflector + node affinity, independent of mode.

This makes galactic-router GoBGP-only and hardcoded, with no --mode
flag at all:

- internal/config/router.go drops the Mode field, its env var/constants,
  and all mode-related Validate() rules.
- cmd/galactic-router/root.go always builds a GoBGP RuntimeFactory
  directly, with no mode switch and no --mode/-m flag.
- internal/reconcile.Reconciler's role filter is hardcoded to
  bgpv1alpha1.RouterRoleTenant instead of comparing against a
  configured mode string, so a stray non-tenant-role BGPRouter is still
  safely skipped rather than reconciled against the GoBGP runtime. A
  new test (TestBuildDesiredRouter_NodeAndRoleFilter) covers this
  skip/proceed behavior directly, since nothing exercised it before.
- The dead RouterMode field on BGPRouterReconciler and the frr stub
  runtime package are deleted outright.
- Both production DaemonSets drop the now-meaningless
  GALACTIC_ROUTER_ROUTER_MODE env entry.
- Docs (architecture reference, router configuration, startup sequence,
  README, CLAUDE.md/AGENTS.md, conventions) are updated throughout to
  stop describing modes that never existed as real choices.

Also removes RuntimeManager.StopAll, found while auditing this same
runtime-abstraction layer: it had zero callers anywhere in the repo and
was never wired to any mode.

No backwards compatibility shim: --mode was already required and only
tenant worked, so this is a hard break with no deprecated no-op flag.

Verified: task build, task lint (0 issues), task test:unit, and task
test:e2e all pass. Also applied to a live deploy/containerlab lab and
ran task verify end-to-end (BGP fabric/peers/transit, EVPN routes, the
gateway canary, and all four VPC ping scenarios) to confirm the
hardcoded tenant-role filter and GoBGP-only startup behave identically
to the mode-switched version in a real multi-cluster deployment.

Fixes #417

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@privateip
privateip force-pushed the refactor/router-417-remove-mode-concept branch from 6e8a496 to 8a85002 Compare August 16, 2026 15:25
@privateip
privateip requested a review from ecv August 16, 2026 15:42
@privateip
privateip merged commit 8baf7d7 into main Aug 16, 2026
11 checks passed
@privateip
privateip deleted the refactor/router-417-remove-mode-concept branch August 16, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

galactic-router's --mode flag offers two backends that were never implemented

2 participants