-
Notifications
You must be signed in to change notification settings - Fork 1.5k
eBPF: fix that local workload with borrowed IPs lose connectivity #11640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
ef1074c to
4365382
Compare
4365382 to
84f1a27
Compare
Fails due to bug.
The old condition checked that the "borrowed" flag was false before checking if the route was a workload. There's no reason that a local workload can't have a borrowed IP, so this was a bug. We now have an explicit "really a local WEP" flag; use that explicitly to avoid confusion with the informational flags (where multiple flags can be set for borrowed IPs).
84f1a27 to
6afa792
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where local workloads with borrowed IPs would lose connectivity in eBPF mode. The issue was that the old code incorrectly excluded routes for local workloads if they had borrowed IPs. The fix introduces an explicit LocalWorkload flag to distinguish actual workload endpoints from IPAM blocks, avoiding confusion with the informational Borrowed flag.
Changes:
- Refactored route classification logic to use explicit
LocalWorkloadflag instead of checking multiple conditions - Added comprehensive test coverage for borrowed workload IPs scenario
- Improved code clarity with better comments explaining the borrowed IP handling
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| felix/calc/l3_route_resolver.go | Sets LocalWorkload flag explicitly for local workload endpoints to disambiguate from IPAM blocks |
| felix/dataplane/linux/bpf_route_mgr.go | Refactored route handling to check GetLocalWorkload() first, then handle IPAM blocks separately |
| felix/fv/routing_test.go | Added new test case for borrowed workload IPs and refactored description strings; contains a bug on line 889 |
| felix/routetable/routeclass_string.go | Auto-generated code update from stringer tool |
Description
The old condition checked that the "borrowed" flag was false before checking if the route was a workload. There's no reason that a local workload can't have a borrowed IP, so this was a bug.
We now have an explicit "really a local WEP" flag; use that explicitly to avoid confusion with the informational flags (where multiple flags can be set for borrowed IPs).
Related issues/PRs
CORE-12198
Todos
Release Note
Reminder for the reviewer
Make sure that this PR has the correct labels and milestone set.
Every PR needs one
docs-*label.docs-pr-required: This change requires a change to the documentation that has not been completed yet.docs-completed: This change has all necessary documentation completed.docs-not-required: This change has no user-facing impact and requires no docs.Every PR needs one
release-note-*label.release-note-required: This PR has user-facing changes. Most PRs should have this label.release-note-not-required: This PR has no user-facing changes.Other optional labels:
cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.