Skip to content
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: handing GRPCRoute hostname from Gateway #6166

Merged
merged 4 commits into from
Jun 8, 2024
Merged

Conversation

tao12345666333
Copy link
Member

@tao12345666333 tao12345666333 commented Jun 7, 2024

What this PR does / why we need it:

There is a test case in the conformance test of GWAPI where hostname is not specified in GRPCRoute, but it is specified in Gateway. Therefore, when routing requests, the configuration for hostname needs to be obtained from Gateway and routes need to be generated accordingly so that request proxying can proceed normally.

Which issue this PR fixes:

fixes: #6136

Special notes for your reviewer:

This can be seen as a fix to the existing logic, or it can be seen as a feature enhancement. However, there won't be too much of a noticeable difference for users, so I didn't add it to the CHANGELOG.

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

- [ ] the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@tao12345666333 tao12345666333 requested a review from a team as a code owner June 7, 2024 12:19
@tao12345666333 tao12345666333 added area/gateway-api Relating to upstream Kubernetes SIG Networking Gateway API and removed size/M labels Jun 7, 2024
@tao12345666333 tao12345666333 self-assigned this Jun 7, 2024
@tao12345666333 tao12345666333 added this to the KIC v3.2.x milestone Jun 7, 2024
@tao12345666333
Copy link
Member Author

When delving into the details, I found that KIC did not cover this case in the processing logic of HTTPRoute.
Perhaps we should also add similar processing logic for HTTPRoute?

@pmalek
Copy link
Member

pmalek commented Jun 7, 2024

The enabled test seems to fail:

https://github.com/Kong/kubernetes-ingress-controller/actions/runs/9417299955/job/25942276779

2024-06-07T12:58:47.7558580Z     --- FAIL: TestGatewayConformance/GRPCExactMethodMatching (0.02s)
2024-06-07T12:58:47.7559692Z         --- PASS: TestGatewayConformance/GRPCExactMethodMatching/2_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/EchoThree'_should_receive_a_Unimplemented_(12) (0.01s)
2024-06-07T12:58:47.7560846Z         --- PASS: TestGatewayConformance/GRPCExactMethodMatching/0_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo'_should_go_to_grpc-infra-backend-v1 (3.25s)
2024-06-07T12:58:47.7561992Z         --- FAIL: TestGatewayConformance/GRPCExactMethodMatching/1_request_to_'/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/EchoTwo'_should_go_to_grpc-infra-backend-v2 (30.00s)

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
@tao12345666333
Copy link
Member Author

The enabled test seems to fail:

https://github.com/Kong/kubernetes-ingress-controller/actions/runs/9417299955/job/25942276779

This is because my current branch has not yet merged the latest changes in the main branch. ac6a0d8 (I skipped that case.)

I have already rebased.

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
Copy link

codecov bot commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 74.19355% with 8 lines in your changes missing coverage. Please review.

Project coverage is 73.7%. Comparing base (74f527d) to head (9c53ba2).
Report is 6 commits behind head on main.

Files Patch % Lines
...al/dataplane/translator/subtranslator/grpcroute.go 73.3% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #6166     +/-   ##
=======================================
- Coverage   73.7%   73.7%   -0.1%     
=======================================
  Files        198     198             
  Lines      19724   19767     +43     
=======================================
+ Hits       14547   14578     +31     
- Misses      4196    4204      +8     
- Partials     981     985      +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
@rainest rainest merged commit c8bbd08 into main Jun 8, 2024
51 checks passed
@rainest rainest deleted the fix-grpc-hostname branch June 8, 2024 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gateway-api Relating to upstream Kubernetes SIG Networking Gateway API size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix failing GRPC conformance test
3 participants