Skip to content
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

Define whether path prefix matches are element-wise or byte-wise #866

Closed
jpeach opened this issue Sep 14, 2021 · 2 comments · Fixed by #869
Closed

Define whether path prefix matches are element-wise or byte-wise #866

jpeach opened this issue Sep 14, 2021 · 2 comments · Fixed by #869
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@jpeach
Copy link
Contributor

jpeach commented Sep 14, 2021

Gateway defines a prefix match like this:

Prefix and Exact paths must be syntactically valid:

  • Must begin with the ‘/’ character
  • Must not contain consecutive ‘/’ characters (e.g. /foo///, //).
  • For prefix paths, a trailing ‘/’ character in the Path is ignored, e.g. /abc and /abc/ specify the same match.

But Ingress V1 says:

Prefix: 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 p of the request path.

I don't recall a discussion about this, but we should discuss whether to align the Gateway prefix semantics with Ingress.

@jpeach jpeach added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 14, 2021
@youngnick
Copy link
Contributor

I am a +1 for making these definitions line up. It makes the migration easier for users, and for Contour, we've already implemented these, so we can easily reuse code.

@hbagdi
Copy link
Contributor

hbagdi commented Sep 15, 2021

+1 to sticking to element-wise.

Any use-cases we know of that won't be satisfied with that approach?

jpeach added a commit to jpeach/gateway-api that referenced this issue Sep 15, 2021
Explicitly align path prefix matching with the Ingress API by specifying
it as an prefix of path elements, not a prefix of bytes.

This fixes kubernetes-sigs#866.

Signed-off-by: James Peach <jpeach@apache.org>
jpeach added a commit to jpeach/gateway-api that referenced this issue Sep 21, 2021
Explicitly align path prefix matching with the Ingress API by specifying
it as an prefix of path elements, not a prefix of bytes.

This fixes kubernetes-sigs#866.

Signed-off-by: James Peach <jpeach@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants