-
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
Clarify route conflicts in the same resource #613
Comments
How about adding a |
Priority works well when number of routes are small. |
We have a few options, I think:
|
I agree that all we can just rely on the position in the list as a final tiebreaker here. I don't have a strong preference as far as order. The current spec uses ascending order in one instance, but it would be a bit easier to implement if we used descending order for this specific condition. The most important thing is that we choose a consistent method of tiebreaking here. It looks like we just need one more addition to https://github.com/kubernetes-sigs/gateway-api/blob/master/apis/v1alpha1/httproute_types.go#L180-L187. |
+1 to what Rob said. We should add this to conflict resolution guidelines. I don't have any preference with ordering either, but it should be consistent across the API (not just rules in HTTPRoute). |
If using the slice sorting, I prefer to choose the route based on the creation timestamp and choose The oldest Route one. |
Okay, for choosing which one wins given two matching Routes in a slice, we have two options then:
The first one feels a little bit more Go-like, the second one is easier to naively implement. Thoughts @robscott and @hbagdi ? Anyone else as well. If none of us have a preference, I'll just go with the second, and make a PR to update the docs Rob linked accordingly. |
I have a slight preference for first one wins, but would be happy with either. In either case, this should be covered by webhook validation so whatever we add as guidance here should really only be relevant as a last resort. |
I ran into a conflict today thinking about implementation and thought it would be best to gather everyone else's thoughts on it.
There is some logic written in the API which states in the event of conflicts occur, how to handle (e.g. The oldest Route based on creation timestamp, or the Route appearing first in alphabetical order).
What if I have an
HTTPRoute
which has the samematches
set, but with differentforwardTo
? We can't apply any timestamp logic since there isn't a resource to compare against.What should a
GET
forlocal.projectcontour.io/
respond with? What conditions should I set?Example:
The text was updated successfully, but these errors were encountered: