Skip to content

smartcontract,controlplane: add flex-algo link/tenant CLI extensions and migrate command#3513

Draft
ben-malbeclabs wants to merge 2 commits intobc/rfc18-pr2from
bc/rfc18-pr3
Draft

smartcontract,controlplane: add flex-algo link/tenant CLI extensions and migrate command#3513
ben-malbeclabs wants to merge 2 commits intobc/rfc18-pr2from
bc/rfc18-pr3

Conversation

@ben-malbeclabs
Copy link
Copy Markdown
Contributor

@ben-malbeclabs ben-malbeclabs commented Apr 10, 2026

RFC-18 flex-algo · PR 3 of 5 · see rfcs/rfc-0018-flex-algo.md
Depends on: #3512 (PR 2)
Series: #3497 · #3512 · #3513 · #3514 · #3515

Summary of Changes

  • Extends doublezero link get/list/update to display topology assignments (link_topologies) and drain status, and adds --link-topology filter and --unicast-drained flag to link update
  • Extends doublezero tenant get/list/update to display included topologies (include_topologies) and adds --include-topologies flag to tenant update
  • Adds doublezero-admin migrate flex-algo [--dry-run] command that backfills link topology assignments and VPNv4 loopback flex-algo node segments across all existing devices and links

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 7 +473 / -32 +441
Scaffolding 5 +18 / -2 +16

Mostly core logic — the migrate command alone is 180 lines of backfill and dry-run orchestration.

Key files (click to expand)
  • controlplane/doublezero-admin/src/cli/migrate.rs — new: migrate flex-algo command; validates UNICAST-DEFAULT PDA exists, backfills link topologies for all links, backfills flex-algo node segments for all VPNv4 loopback interfaces on all devices; supports --dry-run
  • smartcontract/cli/src/link/list.rs — adds --topology <name> filter and displays link_topologies/unicast_drained columns, resolving topology pubkeys to human-readable names
  • smartcontract/cli/src/link/get.rs — displays topology assignments and drain status; fetches topology map to resolve pubkeys to names
  • smartcontract/cli/src/link/update.rs — adds --link-topology and --unicast-drained flags
  • smartcontract/cli/src/tenant/list.rs — displays include_topologies column
  • smartcontract/cli/src/tenant/get.rs — displays included topology names
  • smartcontract/cli/src/tenant/update.rs — adds --include-topologies flag

Testing Verification

  • cargo test -p doublezero_sdk -p doublezero_cli -p doublezero-admin passes
  • cargo clippy -- -D warnings clean
  • make rust-fmt applied before commit

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.

1 participant