-
Notifications
You must be signed in to change notification settings - Fork 593
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
fix: set proper destination port for TCPRoute and UDPRoute #4928
Conversation
b385f15
to
bc75c0c
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4928 +/- ##
=====================================
Coverage 77.6% 77.6%
=====================================
Files 166 166
Lines 18640 18652 +12
=====================================
+ Hits 14473 14485 +12
- Misses 3329 3330 +1
+ Partials 838 837 -1
☔ View full report in Codecov by Sentry. |
bc75c0c
to
0bc6be3
Compare
@pmalek major rework was done, PR description is updated accordingly, PTAL Let's see if I understand gateway-api specification correctly 😛 |
Co-authored-by: Patryk Małek <[email protected]>
Co-authored-by: Patryk Małek <[email protected]>
91b4c66
to
e224eea
Compare
What this PR does / why we need it:
As described in #4864
TCPRoute
sets the incorrect destinations port on the Routes it creates (sets the desired backend service port instead of the listener port). The same happens forUDPRoute
. It ignores the port set by specifyingSectionName
, it always requires the same port for the backend service as for the listener.This PR fixes it for both cases. When
SectionName
is specified take config from it. Otherwise, it works now as described (a little bit vague) in specso every listener that matches the protocol (UDP or TCP) is used.
It breaks current behavior that automatically matches ports by number from target services to listening ports on Gateway with the same numbers.
It is interesting that no conformance test from
gateway-api
catches that problem - a test for this should exist ingateway-api
project.There is also another field for this purpose PortNumber it is part of experimental and extended
gateway-api
, currently KIC doesn't care about it at all. A separate issue has been created to provide support for it and will be prioritized accordingly seeSpec.CommonRouteSpec.ParentRefs[*].Port
in TCPRoute & UDPRoute #4958Which issue this PR fixes:
Fixes #4864
Special notes for your reviewer:
The first commit 1100749 introduces adjustments for
TCPRoute
andTLSRoute
integration tests to check such a scenario. Test forTCPRoute
does not pass, forTLSRoute
bug doesn't exist because matching is done with hostname.The second commit b385f15 introduces actual fix and unit test cases, also for
UDPRoute
. Integration test forUDPRoute
requires refactoring (to make it similar to TCP one) which is not in the scope of this PR due to a major rework of it in PR #4823. After it should be adjusted to test changes introduced in this PR too.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