Skip to content

Prevent premptively allocating routes slice when config.yaml exists - #70

Open
TimEnglart wants to merge 1 commit into
kayrus:masterfrom
TimEnglart:config-routing
Open

TimEnglart wants to merge 1 commit into
kayrus:masterfrom
TimEnglart:config-routing

Conversation

@TimEnglart

@TimEnglart TimEnglart commented Aug 22, 2026

Copy link
Copy Markdown

When you have a config file defined, but have routes unset (not included in the file), it still does not allow the F5 to set your routes. This fixes this so you have to define routes: [] in your config file in order to get the no routing functionality, while allowing you to have it unset and also have a config file for other settings, while having automatically managed routes.

Having this line allocates the slice so the later check to allocate dynamic routes fails, and it is directly assigned to later, so this allocation doesn't need to happen:

gof5/pkg/link/link.go

Lines 323 to 327 in c0f3903

routes := cfg.Routes
if routes == nil {
log.Printf("Applying routes, pushed from F5 VPN server")
routes = cfg.F5Config.Object.Routes
}


Previously:
No config.yaml => F5 managed routes
Unset routes in config.yaml => No routes managed
Set routes: [] in config.yaml => No routes managed
Set routes: [1.1.1.1] in config.yaml => Only routes [1.1.1.1] are used


Now:
No config.yaml => F5 managed routes
Unset routes in config.yaml => F5 managed routes
Set routes: [] in config.yaml => No routes managed
Set routes: [1.1.1.1] in config.yaml => Only routes [1.1.1.1] are used

@TimEnglart TimEnglart changed the title Prevent premptively allocating routes slice when config.yml exists Prevent premptively allocating routes slice when config.yaml exists Aug 22, 2026
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