-
Notifications
You must be signed in to change notification settings - Fork 681
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
handle Route conflicts with HTTPRoute.Matches #6188
handle Route conflicts with HTTPRoute.Matches #6188
Conversation
0dbed73
to
eb08c7f
Compare
eb08c7f
to
b82079e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6188 +/- ##
=======================================
Coverage 81.58% 81.59%
=======================================
Files 133 133
Lines 15815 15861 +46
=======================================
+ Hits 12902 12941 +39
- Misses 2618 2624 +6
- Partials 295 296 +1
|
0accf4f
to
c00ad0b
Compare
All passed now |
e94563f
to
b38eabe
Compare
b38eabe
to
014957f
Compare
Hi @projectcontour/maintainers any chance to get this merged? |
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.
Thanks @lubronzhan, I think this change makes sense though it would definitely be nice to have an upstream Gateway API conformance test to verify against, maybe we can contribute that separately
Add logic to filter Route before adding it to vhost Signed-off-by: lubronzhan <[email protected]>
Signed-off-by: lubronzhan <[email protected]>
…ompare with other match object Signed-off-by: lubronzhan <[email protected]>
Signed-off-by: lubronzhan <[email protected]>
Signed-off-by: lubronzhan <[email protected]>
Signed-off-by: lubronzhan <[email protected]>
Signed-off-by: lubronzhan <[email protected]>
Signed-off-by: lubronzhan <[email protected]>
Signed-off-by: Lubron Zhan <[email protected]>
Signed-off-by: Lubron Zhan <[email protected]>
Signed-off-by: Lubron Zhan <[email protected]>
Signed-off-by: Lubron Zhan <[email protected]>
Signed-off-by: Lubron Zhan <[email protected]>
Signed-off-by: lubronzhan <[email protected]>
ab1a739
to
c7b6ff4
Compare
Do you have any reference. Just saw we are referencing the conformance test here Happy to put it into different PR |
Signed-off-by: Lubron Zhan <[email protected]>
c7b6ff4
to
2ae98cc
Compare
Yeah it would be in the Gateway API repo, the conformance tests are here: https://github.com/kubernetes-sigs/gateway-api/tree/main/conformance/tests You can see some of the past PRs to add tests here: https://github.com/kubernetes-sigs/gateway-api/pulls?q=is%3Apr+label%3Aarea%2Fconformance Happy to pair/provide further pointers if needed |
// check all the routes whether there is conflict against previous rules | ||
if !p.hasConflictRoute(listener, hosts, routes) { |
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.
One case I'm not totally clear on is: what if a rule in a given HTTPRoute has multiple matches defined, and only one of those matches conflicts with another HTTPRoute? Should the entire rule be dropped, or only the match that conflicted? (matches within a rule are logically OR'ed)
https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1.RouteConditionType docs for PartiallyInvalid seem to imply that the entire rule should be dropped, but it's not crystal clear from the spec. I think this PR's implementation is good for now (dropping the entire rule), but this is an example of something that could be clarified and encoded in the upstream conformance test.
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.
Sunjay also mentioned here, in upstream, it does indicate that we should drop at the rule level, if one rule is conflict, just drop it and leave other rules
// 1) Drop Rule(s): With this approach, implementations will drop the
// invalid Route Rule(s) until they are fully valid again. The message
// for this condition MUST start with the prefix "Dropped Rule" and
// include information about which Rules have been dropped. In this
// state, the "Accepted" condition MUST be set to "True" with the latest
// generation of the resource.
Just found out that I did created an issue for tracking conformance test #6227 Thanks for the pointers, will create one for gateway-api |
👍 I'm going to go ahead and merge this now so it doesn't run into any conflicts, can always circle back and address any post-merge feedback if needed before release. Thanks again @lubronzhan! |
When there are conflicts between matches for rules in multiple HTTPRoutes, use the Gateway API conflict resolution rules to determine precedence. Closes projectcontour#3608. Signed-off-by: lubronzhan <[email protected]> Signed-off-by: Saman Mahdanian <[email protected]>
Fix #3608
Now if there is conflicts between HTTPRoute's match, then only the HTTPRoute with
namespace/name
, will be chosen as the valid HTTPRoute, other HTTPRoute will be marked as conflict condition
TODO:
Signed-off-by: lubronzhan [email protected]