-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
gatewayapi: fix buildHTTPVirtualServices match order #50109
Conversation
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.
Great catch; thanks for the fix! LGTM after tests pass
/retest |
kindly ping @howardjohn |
87e5b5a
to
8b0f663
Compare
@@ -799,6 +799,12 @@ func getURIRank(match *istio.HTTPMatchRequest) int { | |||
if match.Uri == nil { | |||
return -1 | |||
} | |||
|
|||
// catch all route should be the lowest priority | |||
if isCatchAll(match) { |
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.
special handler for catch all rout
cc @howardjohn
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.
This seems odd to.
- This function is giving the rank of the URI match. Why is a URI match looking at method, headers, query param.
- Why does sortHTTPRoutes not already account for 'catch all' implicitly? It should make less exact matches lowest priority. Why is that not already happening?
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.
This function is giving the rank of the URI match. Why is a URI match looking at method, headers, query param.
most likely share same logic as func IsCatchAllRoute(r *route.Route) bool {
Why does sortHTTPRoutes not already account for 'catch all' implicitly? It should make less exact matches lowest priority. Why is that not already happening?
The match order from comment is Exact -> Prefix -> Regex
.
if we didn't handle catch all
, any Prefix
or Regex
match will be ignored when istio start to translator to xds after sorting.
@@ -799,6 +799,12 @@ func getURIRank(match *istio.HTTPMatchRequest) int { | |||
if match.Uri == nil { | |||
return -1 | |||
} | |||
|
|||
// catch all route should be the lowest priority | |||
if isCatchAll(match) { |
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.
This seems odd to.
- This function is giving the rank of the URI match. Why is a URI match looking at method, headers, query param.
- Why does sortHTTPRoutes not already account for 'catch all' implicitly? It should make less exact matches lowest priority. Why is that not already happening?
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
🚧 This issue or pull request has been closed due to not having had activity from an Istio team member since 2024-04-08. If you feel this issue or pull request deserves attention, please reopen the issue. Please see this wiki page for more information. Thank you for your contributions. Created by the issue and PR lifecycle manager. |
@zirain: The following tests failed, say
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Please provide a description of this PR:
fix: #50108