-
Notifications
You must be signed in to change notification settings - Fork 472
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
Align path prefix matching with Ingress. #869
Align path prefix matching with Ingress. #869
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jpeach The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
/lgtm
/hold
for others to check though.
/assign @robscott |
Bonus points if someone adds envoy-native support so we don't have to convert it to a regex 🙂(performance+ simplicity - not a huge concern) |
FWIW, I was planning to expand this into two routes with an exact and prefix match. Maybe that won't work out :) |
I think the options are to use regex (runtime cost) or 2 routes (control plane cost, its not just a list of 2 strings but the whole route duplicated I believe). So both aren't ideal... but certainly shouldn't block the API here. |
/lgtm |
73699be
to
89f4afc
Compare
@jpeach, tide/prow won't let us merge things that have "fixes #something" in the commit message - it has to only be in the PR text. Aside from that, Once you've changed the commit message, feel free to cancel the hold. |
Explicitly align path prefix matching with the Ingress API by specifying it as an prefix of path elements, not a prefix of bytes. Signed-off-by: James Peach <jpeach@apache.org>
89f4afc
to
2d76932
Compare
/lgtm /hold cancel |
// Matches based on a URL path prefix split by `/`. Matching is | ||
// case sensitive and done on a path element by element basis. A | ||
// path element refers to the list of labels in the path split by | ||
// the `/` separator. A request is a match for path _p_ if every | ||
// _p_ is an element-wise prefix of the request path. | ||
// | ||
// For example, `/abc`, `/abc/` and `/abc/def` match the prefix | ||
// `/abc`, but `/abcd` does not. | ||
PathMatchExact PathMatchType = "Exact" | ||
|
||
// Matches the URL path exactly and with case sensitivity. | ||
PathMatchPrefix PathMatchType = "Prefix" |
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.
@jpeach 👋 was just looking at this and the godoc for these two (Exact
and Prefix
) are switched.
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.
Explicitly align path prefix matching with the Ingress API by specifying
it as an prefix of path elements, not a prefix of bytes.
What type of PR is this?
/kind bug
/kind api-change
Which issue(s) this PR fixes:
This fixes #866.
Does this PR introduce a user-facing change?: