Ignore link index 0 in GetDefaultGatewayInterface#3459
Merged
tpantelis merged 1 commit intosubmariner-io:develfrom Jun 11, 2025
Merged
Ignore link index 0 in GetDefaultGatewayInterface#3459tpantelis merged 1 commit intosubmariner-io:develfrom
tpantelis merged 1 commit intosubmariner-io:develfrom
Conversation
Previously it returned an error if it found a route with `LinkIndex == 0` which caused an intermittent unit test failure. The unit tests first set up a default gateway which adds a route with link index 99 and, most of the time, this is the first one returned from RouteList. But the fake netlink implementation stores the routes in a map keyed by link index so sometimes RouteList returns the first route with link index 0 since iterating a map occurs in random order. So instead of GetDefaultGatewayInterface returning an error if a route has a 0 LinkIndex, simply ignore it. Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Contributor
|
🤖 Created branch: z_pr3459/tpantelis/fix_ovn_ut_error |
skitt
approved these changes
Jun 10, 2025
dfarrell07
approved these changes
Jun 11, 2025
yboaron
approved these changes
Jun 11, 2025
aswinsuryan
approved these changes
Jun 11, 2025
Contributor
|
🤖 Closed branches: [z_pr3459/tpantelis/fix_ovn_ut_error] |
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.
Previously
GetDefaultGatewayInterfacereturned an error if it found a route withLinkIndex == 0which caused an intermittent unit test failure. The unit tests first set up a default gateway which adds a route with link index 99 and, most of the time, this is the first one returned fromRouteList. But the fake netlink implementation stores the routes in a map keyed by link index so sometimesRouteListreturns the first route with link index 0 since iterating a map occurs in random order.So instead of
GetDefaultGatewayInterfacereturning an error if a route has a 0 LinkIndex, simply ignore it.