-
Notifications
You must be signed in to change notification settings - Fork 589
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
implement assigning priorities to Kong routes translated from HTTPRoute
#4296
Conversation
01e5533
to
d250d80
Compare
HTTPRoute
HTTPRoute
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.
Some minor comments. I might not be an expert here but I believe splitted
shouldn't be used and instead we should use split
as past participle of split
.
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.
Are we able to pre-process HTTPRoutes for validity and register errors regardless of whether we're using expression routes or not?
It's not quite obvious from the diff but it looks like this will introduce a separate validation path for expression and traditional mode, even though the issues aren't exclusive to one mode (e.g. ErrRouteValidationNoMatchRulesOrHostnamesSpecified
and the results of validateHTTPRoute()
depend only on the contents of the original resource, not which type of Kong route we're translating to).
If we have those checks separately in the mode translators, we're likely to miss checks in one or the other (we ran into this with CombinedRoutes) and need more test coverage, so if we can validate before translating, we should.
Sounds good, but if we extract the validation code, it will affect the original translation code in multiple places. This would make the PR to be even larger and harder for a detailed review. I suggest to finish it in another PR. @rainest would you please create another issue to extract the validation and translation failure code (and add it to 2.11 milestone)? |
676bf97
to
c6502c7
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #4296 +/- ##
=======================================
+ Coverage 64.9% 65.4% +0.4%
=======================================
Files 154 154
Lines 17384 17722 +338
=======================================
+ Hits 11297 11603 +306
- Misses 5367 5388 +21
- Partials 720 731 +11
☔ View full report in Codecov by Sentry. |
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.
It looks good @randmonkey! Can you please re-enable the header matching conformance test to verify we are actually fixing that issue?
kubernetes-ingress-controller/test/conformance/gateway_conformance_test.go
Lines 85 to 86 in 2b13580
tests.HTTPRouteHeaderMatching.ShortName, | |
I think this conformance should be re-enabled when KIC can run with L4 proxy with expression router: #4312 because the |
There are no conformance tests for L4 routes so far. There are L7-only conformance tests upstream, so I don't think it is a problem 🤔 |
There is ONE 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.
🚀
Co-authored-by: Mattia Lavacca <lavacca.mattia@gmail.com>
It looks like the conformance test is broken. No idea why it was passing 🤔 |
What this PR does / why we need it:
Assign priorities to Kong routes translated from
HTTPRoute
s.Which issue this PR fixes:
fixes #4249
Special notes for your reviewer:
PR Readiness Checklist:
Complete these before marking the PR as
ready to review
:CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR