Skip to content

controller: make MaxUserTunnelSlots configurable via flag/config #3745

@elitegreg

Description

@elitegreg

Why

Doc work-plan item 2.a (see Notion design). The constant in controlplane/controller/config/constants.go:8 currently sizes per-device tunnel slices (models.go:213, models.go:225). The stress controller needs to run with the EOS hard cap of 1024 without touching production code paths.

Scope

  • Replace the MaxUserTunnelSlots constant with a field on the controller's runtime Config.
  • Add a flag (--max-user-tunnel-slots) and an equivalent config-file key, default 128. Validate 1 ≤ value ≤ 1024.
  • Thread the value through all current uses (search MaxUserTunnelSlots — primary call sites in controlplane/controller/internal/controller/models.go:213 and :225).
  • Update controlplane/controller/internal/controller/server_test.go and controlplane/controller/internal/controller/render_test.go to inject the value through the controller fixture rather than reading the constant; cross-check e2e/ibrl_with_allocated_ip_test.go.
  • Keep StartUserTunnelNum = 500 unchanged.

Acceptance

  • Default behavior unchanged when flag/config-key is unset (still 128).
  • Stress controller can be started with --max-user-tunnel-slots=1024 and renders 1024 slots end-to-end.
  • All existing tests pass; tests that hard-coded the constant now read it from a fixture.

Notes

Onchain serviceability program is not changed by this issue (doc explicitly excludes that). The cap is enforced controller-side only.

Tracker: #3744.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions