Skip to content

fix: merge route match rule with match all route#8011

Merged
arkodg merged 4 commits intoenvoyproxy:mainfrom
zirain:fix/route-match-order
Jan 25, 2026
Merged

fix: merge route match rule with match all route#8011
arkodg merged 4 commits intoenvoyproxy:mainfrom
zirain:fix/route-match-order

Conversation

@zirain
Copy link
Copy Markdown
Member

@zirain zirain commented Jan 21, 2026

Fixes: #8010

Signed-off-by: zirain <[email protected]>
@zirain zirain requested a review from a team as a code owner January 21, 2026 06:06
@netlify
Copy link
Copy Markdown

netlify bot commented Jan 21, 2026

Deploy Preview for cerulean-figolla-1f9435 canceled.

Name Link
🔨 Latest commit 93a3f2c
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6975a45799c0490008cad56b

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 61.90476% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.70%. Comparing base (ced5d75) to head (a358f3d).

Files with missing lines Patch % Lines
internal/gatewayapi/sort.go 61.90% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8011   +/-   ##
=======================================
  Coverage   73.69%   73.70%           
=======================================
  Files         237      237           
  Lines       35653    35656    +3     
=======================================
+ Hits        26274    26279    +5     
+ Misses       7520     7518    -2     
  Partials     1859     1859           

☔ 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.

Signed-off-by: zirain <[email protected]>
@zirain zirain changed the title fix: rule order with match all route fix: merge route match rule with match all route Jan 21, 2026
Signed-off-by: zirain <[email protected]>
@zirain zirain force-pushed the fix/route-match-order branch from 9b63b3c to c3d5ab4 Compare January 22, 2026 01:43
@zirain zirain requested a review from zhaohuabing January 22, 2026 01:45
func (x XdsIRRoutes) Less(i, j int) bool {
// 1. Sort based on path match type
// Exact > RegularExpression > PathPrefix
if x[i].PathMatch != nil && x[i].PathMatch.Exact != nil {
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.

are these changes needed or can we rely on L149 for the fix ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

these aren't a must for the fix, I could revert it if you think it's meaningless.

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.

trying to understand the why, cyclomatic complexity is same, and readbility feels fine

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Triple if x[i].PathMatch != nil && make me feels a little hard to understand during debugging this, that's why I change it.

@zirain zirain force-pushed the fix/route-match-order branch from c3d5ab4 to 2717717 Compare January 22, 2026 08:19
@zirain zirain requested a review from arkodg January 22, 2026 08:19
Copy link
Copy Markdown

@arko-oai arko-oai left a comment

Choose a reason for hiding this comment

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

LGTM thanks

arkodg
arkodg previously approved these changes Jan 24, 2026
@zirain zirain force-pushed the fix/route-match-order branch from 2717717 to 93a3f2c Compare January 25, 2026 04:13
@zirain zirain requested a review from arkodg January 25, 2026 04:13
@zirain zirain force-pushed the fix/route-match-order branch 2 times, most recently from a358f3d to 93a3f2c Compare January 25, 2026 05:04
@arkodg arkodg merged commit 8c5c9f3 into envoyproxy:main Jan 25, 2026
82 of 86 checks passed
zirain added a commit to zirain/gateway that referenced this pull request Jan 26, 2026
rudrakhp pushed a commit to rudrakhp/gateway that referenced this pull request Jan 26, 2026
zirain added a commit that referenced this pull request Jan 26, 2026
* fix: fail fast when unrecoverable discovery errors happens on checking optional CRDs (#7872)

* fail fast when unrecoverable discovery errors happens

Signed-off-by: Huabing Zhao <[email protected]>

* only retry transient errors

Signed-off-by: Huabing Zhao <[email protected]>

* fix potenial dead lock

Signed-off-by: Huabing Zhao <[email protected]>

* address comments

Signed-off-by: Huabing Zhao <[email protected]>

* minor wording

Signed-off-by: Huabing Zhao <[email protected]>

* create discovery client once

Signed-off-by: Huabing Zhao <[email protected]>

* fix lint

Signed-off-by: Huabing Zhao <[email protected]>

* address comments

Signed-off-by: Huabing Zhao <[email protected]>

* remove redundant logging

Signed-off-by: Huabing Zhao <[email protected]>

* add e2e test

Signed-off-by: Huabing Zhao <[email protected]>

* fix test

Signed-off-by: Huabing(Robin) Zhao <[email protected]>

* fix test

Signed-off-by: Huabing(Robin) Zhao <[email protected]>

---------

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* fix: extproc is discarded with failOpen is enabled for wasm (#7956)

* fix: extproc is discarded with failOpen is enabled for wasm

Signed-off-by: Huabing Zhao <[email protected]>

* add test

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* polish code

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* add test

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

---------

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* fix: sanitize control plane config dump (#7901)

* mask secrets

Signed-off-by: Huabing Zhao <[email protected]>

* address comments

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

---------

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* fix: server run race (#7964)

* add test

Signed-off-by: zirain <[email protected]>

* fix race

Signed-off-by: zirain <[email protected]>

* fix lint

Signed-off-by: zirain <[email protected]>

* fix

Signed-off-by: zirain <[email protected]>

* fix

Signed-off-by: zirain <[email protected]>

* fix lint

Signed-off-by: zirain <[email protected]>

* use Semaphore instead of WaitGroup

Signed-off-by: zirain <[email protected]>

* comments

Signed-off-by: zirain <[email protected]>

* lint

Signed-off-by: zirain <[email protected]>

* fix

Signed-off-by: zirain <[email protected]>

* fix lint

Signed-off-by: zirain <[email protected]>

* callback

Signed-off-by: zirain <[email protected]>

* fix lint

Signed-off-by: zirain <[email protected]>

* run hook sequentially

Signed-off-by: zirain <[email protected]>

* fix lint

Signed-off-by: zirain <[email protected]>

* rename to cfgMux

Signed-off-by: zirain <[email protected]>

---------

Signed-off-by: zirain <[email protected]>

* fix: wrong cluster type with mixed FQDN backend and service backend refs (#7994)

* fix: wrong cluster type with mixed FQDN backend and service backend refs

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* fix mirror cluster endpoint type

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* simplify the test

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* update comment

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

---------

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* fix: merge route match rule with match all route (#8011)

Signed-off-by: zirain <[email protected]>

* fix gen

Signed-off-by: zirain <[email protected]>

* fix lint

Signed-off-by: zirain <[email protected]>

* fix for golang 11.24

Signed-off-by: zirain <[email protected]>

* fix lint

Signed-off-by: zirain <[email protected]>

* fix watch CRD version

Signed-off-by: zirain <[email protected]>

---------

Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: zirain <[email protected]>
Co-authored-by: Huabing (Robin) Zhao <[email protected]>
rudrakhp added a commit that referenced this pull request Jan 26, 2026
* fix: extproc is discarded with failOpen is enabled for wasm (#7956)

* fix: extproc is discarded with failOpen is enabled for wasm

Signed-off-by: Huabing Zhao <[email protected]>

* add test

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* polish code

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* add test

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

---------

Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix: sanitize control plane config dump (#7901)

* mask secrets

Signed-off-by: Huabing Zhao <[email protected]>

* address comments

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

---------

Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix: server run race (#7964)

* add test

Signed-off-by: zirain <[email protected]>

* fix race

Signed-off-by: zirain <[email protected]>

* fix lint

Signed-off-by: zirain <[email protected]>

* fix

Signed-off-by: zirain <[email protected]>

* fix

Signed-off-by: zirain <[email protected]>

* fix lint

Signed-off-by: zirain <[email protected]>

* use Semaphore instead of WaitGroup

Signed-off-by: zirain <[email protected]>

* comments

Signed-off-by: zirain <[email protected]>

* lint

Signed-off-by: zirain <[email protected]>

* fix

Signed-off-by: zirain <[email protected]>

* fix lint

Signed-off-by: zirain <[email protected]>

* callback

Signed-off-by: zirain <[email protected]>

* fix lint

Signed-off-by: zirain <[email protected]>

* run hook sequentially

Signed-off-by: zirain <[email protected]>

* fix lint

Signed-off-by: zirain <[email protected]>

* rename to cfgMux

Signed-off-by: zirain <[email protected]>

---------

Signed-off-by: zirain <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix: wrong cluster type with mixed FQDN backend and service backend refs (#7994)

* fix: wrong cluster type with mixed FQDN backend and service backend refs

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* fix mirror cluster endpoint type

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* simplify the test

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* update comment

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

---------

Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix: fail fast when unrecoverable discovery errors happens on checking optional CRDs (#7872)

* fail fast when unrecoverable discovery errors happens

Signed-off-by: Huabing Zhao <[email protected]>

* only retry transient errors

Signed-off-by: Huabing Zhao <[email protected]>

* fix potenial dead lock

Signed-off-by: Huabing Zhao <[email protected]>

* address comments

Signed-off-by: Huabing Zhao <[email protected]>

* minor wording

Signed-off-by: Huabing Zhao <[email protected]>

* create discovery client once

Signed-off-by: Huabing Zhao <[email protected]>

* fix lint

Signed-off-by: Huabing Zhao <[email protected]>

* address comments

Signed-off-by: Huabing Zhao <[email protected]>

* remove redundant logging

Signed-off-by: Huabing Zhao <[email protected]>

* add e2e test

Signed-off-by: Huabing Zhao <[email protected]>

* fix test

Signed-off-by: Huabing(Robin) Zhao <[email protected]>

* fix test

Signed-off-by: Huabing(Robin) Zhao <[email protected]>

---------

Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix: merge route match rule with match all route (#8011)

Signed-off-by: zirain <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix: do not set autoHTTPConfig when used mixed(HTTP + HTTPS) backends (#7950)

* fix: do not set autoHTTPConfig when used mixed backend

Signed-off-by: zirain <[email protected]>

* release notes

Signed-off-by: zirain <[email protected]>

* fix

Signed-off-by: zirain <[email protected]>

* add e2e

Signed-off-by: zirain <[email protected]>

---------

Signed-off-by: zirain <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix: backend tls default namespace (#7987)

Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix: race in gatewaapi runner (#8037)

* add testcase

Signed-off-by: zirain <[email protected]>

* fix

Signed-off-by: zirain <[email protected]>

* simply

Signed-off-by: zirain <[email protected]>

---------

Signed-off-by: zirain <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* [release/v1.6] v1.6.3 release notes (#8054)

Signed-off-by: Rudrakh Panigrahi <[email protected]>

* v1.6.3 version

Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix gen-check

Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix lint

Signed-off-by: Rudrakh Panigrahi <[email protected]>

---------

Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>
Signed-off-by: zirain <[email protected]>
Co-authored-by: Huabing (Robin) Zhao <[email protected]>
Co-authored-by: zirain <[email protected]>
SadmiB pushed a commit to SadmiB/gateway that referenced this pull request Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge route match rule result wrong

4 participants