Prevent premptively allocating routes slice when config.yaml exists - #70
Open
TimEnglart wants to merge 1 commit into
Open
TimEnglart wants to merge 1 commit into
TimEnglart wants to merge 1 commit into
Conversation
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.
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
Previously:
No
config.yaml=> F5 managed routesUnset
routesinconfig.yaml=> No routes managedSet
routes: []inconfig.yaml=> No routes managedSet
routes: [1.1.1.1]inconfig.yaml=> Only routes[1.1.1.1]are usedNow:
No
config.yaml=> F5 managed routesUnset
routesinconfig.yaml=> F5 managed routesSet
routes: []inconfig.yaml=> No routes managedSet
routes: [1.1.1.1]inconfig.yaml=> Only routes[1.1.1.1]are used