Fix OVN-K Interconnect: Remove deprecated nexthop field - #4125
Conversation
OVN 26.03.3+ (OCP 4.21.27+, 4.22.6+) ignores Logical Router Policies that have the deprecated 'nexthop' (singular) field set, even when 'nexthops' (array) is correctly populated. This causes RouteAgent health checks to fail because ovn-northd does not generate southbound flows for these policies, logging: 'policy uses deprecated column nexthop, this column is ignored' Why not keep both fields? Manual testing showed that when BOTH nexthop and nexthops are set, ovn-northd ignores the entire policy. Only when nexthop field is cleared (leaving only nexthops populated) does the southbound flow appear and RouteAgent health checks succeed. Fixes: submariner-io#4124 Signed-off-by: Yossi Boaron <yboaron@redhat.com>
|
🤖 Created branch: z_pr4125/yboaron/fix-ovn-nexthop-deprecated-field |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughLogical router policy reconciliation now uses the ChangesLogical route policy reconciliation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/routeagent_driver/handlers/ovn/ovn_logical_routes.go`:
- Around line 116-118: The stale-policy predicate in the OVN logical route
reconciliation must also match policies whose legacy Nexthop field is non-nil,
even when Nexthops equals []string{nextHop}; update the condition around the
existing remoteSubnets and Nexthops checks to include that legacy-field state,
and add a regression test covering a managed policy with both Nexthop and
Nexthops populated.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1e395212-0ec3-439c-abb8-3d5f19bcc0a2
📒 Files selected for processing (1)
pkg/routeagent_driver/handlers/ovn/ovn_logical_routes.go
Enhance stale policy detection to also match policies with the deprecated Nexthop field set, even when Nexthops is correctly populated. This ensures complete migration from old Submariner versions. Add regression test that verifies: - Old policies with both Nexthop (deprecated) and Nexthops (correct) set - Are detected as stale and replaced during reconciliation - New policies have only Nexthops field (Nexthop is nil) Addresses: CodeRabbit actionable comment on PR submariner-io#4125 Signed-off-by: Yossi Boaron <yboaron@redhat.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/routeagent_driver/handlers/ovn/handler_test.go`:
- Around line 638-651: Update the reconciliation test around the existing policy
assertions to save the original oldPolicy.Nexthop pointer before reconciliation,
then call AwaitNoModel with the matching policy and deprecated Nexthop value to
verify the legacy policy is removed. Keep the existing assertions confirming the
replacement policy has Nexthops populated and Nexthop nil.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5e5fb236-fb34-423b-8ca4-912b4f196773
📒 Files selected for processing (2)
pkg/routeagent_driver/handlers/ovn/handler_test.gopkg/routeagent_driver/handlers/ovn/ovn_logical_routes.go
🚧 Files skipped from review as they are similar to previous changes (1)
- pkg/routeagent_driver/handlers/ovn/ovn_logical_routes.go
Enhance stale policy detection to also match policies with the deprecated Nexthop field set, even when Nexthops is correctly populated. This ensures complete migration from old Submariner versions. Add regression test that verifies: - Old policies with both Nexthop (deprecated) and Nexthops (correct) set - Are detected as stale and replaced during reconciliation - New policies have only Nexthops field (Nexthop is nil) Addresses: CodeRabbit actionable comment on PR submariner-io#4125 Signed-off-by: Yossi Boaron <yboaron@redhat.com>
d843a6d to
d756ecc
Compare
Enhance stale policy detection to also match policies with the deprecated Nexthop field set, even when Nexthops is correctly populated. This ensures complete migration from old Submariner versions. Add regression test that verifies: - Old policies with both Nexthop (deprecated) and Nexthops (correct) set - Are detected as stale and replaced during reconciliation - New policies have only Nexthops field (Nexthop is nil) Addresses: CodeRabbit actionable comment on PR submariner-io#4125 Signed-off-by: Yossi Boaron <yboaron@redhat.com>
d756ecc to
7b3c173
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/routeagent_driver/handlers/ovn/handler_test.go`:
- Around line 691-695: The fake OVN client’s logical router policy matching
ignores the expected Nexthops field, allowing replacement policies to match
incorrectly. Update hasModel and GetModel to reuse one shared matcher that
compares Nexthops when the expected model specifies it, while treating
unspecified fields as wildcards to preserve existing match-only lookups.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ce1f7be3-c300-49e8-96e6-fe063aa83540
📒 Files selected for processing (1)
pkg/routeagent_driver/handlers/ovn/handler_test.go
Enhance stale policy detection to also match policies with the deprecated Nexthop field set, even when Nexthops is correctly populated. This ensures complete migration from old Submariner versions. Add regression test that verifies: - Old policies with both Nexthop (deprecated) and Nexthops (correct) set - Are detected as stale and replaced during reconciliation - New policies have only Nexthops field (Nexthop is nil) Addresses: CodeRabbit actionable comment on PR submariner-io#4125 Signed-off-by: Yossi Boaron <yboaron@redhat.com>
7b3c173 to
3bd8555
Compare
Enhance stale policy detection to also match policies with the deprecated Nexthop field set, even when Nexthops is correctly populated. This ensures complete migration from old Submariner versions. Add regression test that verifies: - Old policies with both Nexthop (deprecated) and Nexthops (correct) set - Are detected as stale and replaced during reconciliation - New policies have only Nexthops field (Nexthop is nil) Addresses: CodeRabbit actionable comment on PR submariner-io#4125 Signed-off-by: Yossi Boaron <yboaron@redhat.com>
3bd8555 to
188961b
Compare
Enhance stale policy detection to also match policies with the deprecated Nexthop field set, even when Nexthops is correctly populated. This ensures complete migration from old Submariner versions. Add regression test that verifies: - Old policies with both Nexthop (deprecated) and Nexthops (correct) set - Are detected as stale and replaced during reconciliation - New policies have only Nexthops field (Nexthop is nil) Addresses: CodeRabbit actionable comment on PR submariner-io#4125 Signed-off-by: Yossi Boaron <yboaron@redhat.com>
188961b to
5d667c9
Compare
|
🤖 Closed branches: [z_pr4125/yboaron/fix-ovn-nexthop-deprecated-field] |
Enhance stale policy detection to also match policies with the deprecated Nexthop field set, even when Nexthops is correctly populated. This ensures complete migration from old Submariner versions. Add regression test that verifies: - Old policies with both Nexthop (deprecated) and Nexthops (correct) set - Are detected as stale and replaced during reconciliation - New policies have only Nexthops field (Nexthop is nil) Addresses: CodeRabbit actionable comment on PR #4125 Signed-off-by: Yossi Boaron <yboaron@redhat.com>
Enhance stale policy detection to also match policies with the deprecated Nexthop field set, even when Nexthops is correctly populated. This ensures complete migration from old Submariner versions. Add regression test that verifies: - Old policies with both Nexthop (deprecated) and Nexthops (correct) set - Are detected as stale and replaced during reconciliation - New policies have only Nexthops field (Nexthop is nil) Addresses: CodeRabbit actionable comment on PR #4125 Signed-off-by: Yossi Boaron <yboaron@redhat.com>
OVN 26.03.3+ (OCP 4.21.27+, 4.22.6+) ignores Logical Router Policies that have the deprecated 'nexthop' (singular) field set, even when 'nexthops' (array) is correctly populated.
This causes RouteAgent health checks to fail because ovn-northd does not generate southbound flows for these policies, logging:
'policy uses deprecated column nexthop, this column is ignored'
Why not keep both fields?
Manual testing showed that when BOTH nexthop and nexthops are set, ovn-northd ignores the entire policy. Only when nexthop field is cleared (leaving only nexthops populated) does the southbound flow appear and RouteAgent health checks succeed.
Fixes: #4124
Summary by CodeRabbit