Skip to content

Ignore link index 0 in GetDefaultGatewayInterface#3459

Merged
tpantelis merged 1 commit intosubmariner-io:develfrom
tpantelis:fix_ovn_ut_error
Jun 11, 2025
Merged

Ignore link index 0 in GetDefaultGatewayInterface#3459
tpantelis merged 1 commit intosubmariner-io:develfrom
tpantelis:fix_ovn_ut_error

Conversation

@tpantelis
Copy link
Copy Markdown
Contributor

@tpantelis tpantelis commented Jun 10, 2025

Previously GetDefaultGatewayInterface 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.

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>
@submariner-bot
Copy link
Copy Markdown
Contributor

🤖 Created branch: z_pr3459/tpantelis/fix_ovn_ut_error
🚀 Full E2E won't run until the "ready-to-test" label is applied. I will add it automatically once the PR has 2 approvals, or you can add it manually.

@tpantelis tpantelis requested a review from aswinsuryan June 10, 2025 18:34
@tpantelis tpantelis moved this from Todo to In Review in Submariner 0.21 Jun 10, 2025
@submariner-bot submariner-bot added the ready-to-test When a PR is ready for full E2E testing label Jun 11, 2025
@tpantelis tpantelis enabled auto-merge (rebase) June 11, 2025 13:45
@tpantelis tpantelis merged commit 7c0ab17 into submariner-io:devel Jun 11, 2025
50 of 55 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in Submariner 0.21 Jun 11, 2025
@submariner-bot
Copy link
Copy Markdown
Contributor

🤖 Closed branches: [z_pr3459/tpantelis/fix_ovn_ut_error]

@dfarrell07 dfarrell07 added the backport This change requires a backport to eligible release branches label Jun 17, 2025
@tpantelis tpantelis removed the backport This change requires a backport to eligible release branches label Jun 18, 2025
@tpantelis tpantelis deleted the fix_ovn_ut_error branch April 16, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-test When a PR is ready for full E2E testing

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants