controller: make MaxUserTunnelSlots configurable via flag#3751
Open
nikw9944 wants to merge 4 commits into
Open
controller: make MaxUserTunnelSlots configurable via flag#3751nikw9944 wants to merge 4 commits into
nikw9944 wants to merge 4 commits into
Conversation
1fb63f2 to
d22dcf9
Compare
Add --max-user-tunnel-slots CLI flag to override the per-device user tunnel slot count at runtime. The package constant MaxUserTunnelSlots is renamed DefaultMaxUserTunnelSlots and supplies the default (128); NewController validates 1 <= n <= 1024 (Arista EOS hard cap) and returns ErrInvalidMaxUserTunnelSlots otherwise. NewDevice takes the slot count as a parameter rather than reading the package constant. Enables the GRE Tunnel Capacity Study stress controller (tracker #3744) to render up to 1024 slots end-to-end without touching production code paths. No onchain or wire-format changes. Fixes #3745
- errors.Is in TestMaxUserTunnelSlotsOption so future error wrapping in NewController stays compatible - ErrInvalidMaxUserTunnelSlots is now a bare sentinel; NewController wraps it with fmt.Errorf to include the offending value - WithMaxUserTunnelSlots godoc notes validation timing - NewDevice godoc states the tunnelSlots precondition Refs #3745
- drop the upper-bound hard cap; only require a positive integer - remove block comments on NewDevice and WithMaxUserTunnelSlots - shorten CHANGELOG entry Refs #3745
d22dcf9 to
a493e06
Compare
elitegreg
approved these changes
May 22, 2026
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.
Summary of Changes
--max-user-tunnel-slotsCLI flag on the controller to override the per-device user-tunnel slot count at runtime (default remains 128).MaxUserTunnelSlots→DefaultMaxUserTunnelSlotsto make the override path explicit; update all internal callers (controller, e2e tests).Resolves: controller: make MaxUserTunnelSlots configurable via flag/config #3745
Diff Breakdown
Testing Verification
server_test.go