Skip to content

Commit

Permalink
Merge pull request #1401 from sunjayBhatia/route-matching-clarification
Browse files Browse the repository at this point in the history
Clarify HTTPRoute matching precedence
  • Loading branch information
k8s-ci-robot authored Sep 22, 2022
2 parents ee7a838 + 42bf758 commit 522a3b3
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 76 deletions.
24 changes: 16 additions & 8 deletions apis/v1beta1/httproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ type HTTPRouteSpec struct {
// implementation must raise an 'Accepted' Condition with a status of
// `False` in the corresponding RouteParentStatus.
//
// In the event that multiple HTTPRoutes specify intersecting hostnames (e.g.
// overlapping wildcard matching and exact matching hostnames), precedence must
// be given to rules from the HTTPRoute with the largest number of:
//
// * Characters in a matching non-wildcard hostname.
// * Characters in a matching hostname.
//
// If ties exist across multiple Routes, the matching precedence rules for
// HTTPRouteMatches takes over.
//
// Support: Core
//
// +optional
Expand Down Expand Up @@ -142,12 +152,10 @@ type HTTPRouteRule struct {
// HTTP request.
//
// Proxy or Load Balancer routing configuration generated from HTTPRoutes
// MUST prioritize rules based on the following criteria, continuing on
// ties. Precedence must be given to the Rule with the largest number
// of:
// MUST prioritize matches based on the following criteria, continuing on
// ties. Across all rules specified on applicable Routes, precedence must be
// given to the match with the largest number of:
//
// * Characters in a matching non-wildcard hostname.
// * Characters in a matching hostname.
// * Characters in a matching path.
// * Header matches.
// * Query param matches.
Expand All @@ -159,9 +167,9 @@ type HTTPRouteRule struct {
// * The Route appearing first in alphabetical order by
// "{namespace}/{name}".
//
// If ties still exist within the Route that has been given precedence,
// matching precedence MUST be granted to the FIRST matching rule (in list
// order) meeting the above criteria.
// If ties still exist within an HTTPRoute, matching precedence MUST be granted
// to the FIRST matching rule (in list order) with a match meeting the above
// criteria.
//
// When no rules matching a request have been successfully attached to the
// parent a request is coming from, a HTTP 404 status code MUST be returned.
Expand Down
78 changes: 44 additions & 34 deletions config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 44 additions & 34 deletions config/crd/standard/gateway.networking.k8s.io_httproutes.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 522a3b3

Please sign in to comment.