Skip to content

fix: Add overlap status for duplicate HTTPRoutes#8373

Open
jukie wants to merge 3 commits intoenvoyproxy:mainfrom
jukie:route-overlap
Open

fix: Add overlap status for duplicate HTTPRoutes#8373
jukie wants to merge 3 commits intoenvoyproxy:mainfrom
jukie:route-overlap

Conversation

@jukie
Copy link
Copy Markdown
Contributor

@jukie jukie commented Feb 28, 2026

What this PR does / why we need it:
The first route that gets applied will take precedence but subsequent routes don't show any indication that they're being ignored. This adds a an Overlap status to ResolvedRefs to communicate this behavior to users.

Fixes #8101

Release Notes: Yes

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 28, 2026

Deploy Preview for cerulean-figolla-1f9435 canceled.

Name Link
🔨 Latest commit ed22848
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/69aef12c5e19730008a85cb8

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 83.05085% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.15%. Comparing base (8104247) to head (ed22848).

Files with missing lines Patch % Lines
internal/gatewayapi/route.go 82.90% 10 Missing and 10 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8373      +/-   ##
==========================================
- Coverage   74.18%   74.15%   -0.04%     
==========================================
  Files         242      242              
  Lines       37579    37697     +118     
==========================================
+ Hits        27879    27953      +74     
- Misses       7760     7790      +30     
- Partials     1940     1954      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jukie jukie changed the title route overlap fix: Add overlap status for duplicate HTTPRoutes Feb 28, 2026
@jukie jukie marked this pull request as ready for review February 28, 2026 21:14
@jukie jukie requested a review from a team as a code owner February 28, 2026 21:14
@jukie
Copy link
Copy Markdown
Contributor Author

jukie commented Feb 28, 2026

/retest

@zirain
Copy link
Copy Markdown
Member

zirain commented Mar 1, 2026

will this fix HTTPRouteHostnameIntersection conformance test?

Ignore above, it's fixed by #8186

// indicating that they match the same set of requests.
// This detects routes with the same hostname and identical exact path, header, query param,
// and cookie match conditions. Only routes with explicit exact path matches are checked;
// prefix path matches can intentionally overlap across HTTPRoute resources
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intersection/overlap case seems like a useful signal in status

}

if hasOverlap {
routeStatus := GetRouteStatus(httpRoute)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we keep resolvedRefs as as, and add an additonal warning condition ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Probably just set Accepted as False with the conflicted message?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accepted=false has a bigger impact imo, this is more of an Ignore case, similar to the Overriden condition in Policy which is tied to a subset of rules and matches in the route

status: "True"
type: Accepted
- lastTransitionTime: null
message: Overlapping match conditions with another HTTPRoute on the same listener
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we include the name of the conflicting routes in the status message? That would make it much easier for users to identify the source of the conflict when this happens.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

jukie added 2 commits March 9, 2026 07:18
Signed-off-by: jukie <isaac.wilson514@gmail.com>
Signed-off-by: jukie <isaac.wilson514@gmail.com>
@jukie jukie requested review from arkodg and zhaohuabing March 9, 2026 16:08
Signed-off-by: jukie <isaac.wilson514@gmail.com>
overlap: false,
},
{
name: "prefix paths are not detected as overlap",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should two prefix matches with the same value also be considered overlapping? This could also cause simliar confusion for users, like exact does in #8101 when the backends are different.

overlap: false,
},
{
name: "nil path matches are not detected as overlap",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, should this also be considered overlapping?

overlap: true,
},
{
name: "regex path matches are not detected as overlap",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, should this also be considered overlapping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTPRoute overlap does not result in status conditions being set

4 participants