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

Support response header filter for GRPCRoute #1983

Merged
merged 1 commit into from
May 16, 2024

Conversation

ciarams87
Copy link
Member

@ciarams87 ciarams87 commented May 16, 2024

Proposed changes

Problem: As a user, I want to be able to add ResponseHeaderModifier filter for my GRPCRoutes.

Solution: Add support for ResponseHeaderModifier filter for my GRPCRoutes. The implementation reuses validation and logic from the HTTPRoute implementation. This PR also removes some redundant empty structs in the servers_test.go

Testing: The functionality is identical to HTTPRoute so not much additional testing is required. I tested locally using echo server and grpcurl. I didn't modify the application to configure headers on the upstream side, but we can see the response headers set in the GRPCRoute spec have been returned:

Response headers received:
content-type: application/grpc
date: Thu, 16 May 2024 10:06:44 GMT
server: nginx/1.25.5
x-header-add: this-is-the-appended-value
x-header-set: overwritten-value

Closes #1935

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

Added support for Response Header Modifier filter for GRPCRoute

@ciarams87 ciarams87 requested review from a team as code owners May 16, 2024 10:12
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request labels May 16, 2024
Copy link

codecov bot commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.92%. Comparing base (869ac38) to head (f0e75dc).
Report is 1 commits behind head on main.

❗ Current head f0e75dc differs from pull request most recent head 556c8c7. Consider uploading reports for the commit 556c8c7 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1983      +/-   ##
==========================================
+ Coverage   86.90%   86.92%   +0.01%     
==========================================
  Files          88       88              
  Lines        6056     6064       +8     
  Branches       50       50              
==========================================
+ Hits         5263     5271       +8     
  Misses        741      741              
  Partials       52       52              

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

@ciarams87 ciarams87 force-pushed the feat/grpc-response-header-filter branch from 7afe38a to 66bd9f7 Compare May 16, 2024 10:21
Copy link
Contributor

@ADubhlaoich ADubhlaoich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM docs-wise!

@bjee19
Copy link
Contributor

bjee19 commented May 16, 2024

👍

@ciarams87 ciarams87 force-pushed the feat/grpc-response-header-filter branch from 66bd9f7 to f0e75dc Compare May 16, 2024 16:11
Copy link
Contributor

@kate-osborn kate-osborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@ciarams87 ciarams87 force-pushed the feat/grpc-response-header-filter branch from f0e75dc to 556c8c7 Compare May 16, 2024 17:02
@ciarams87 ciarams87 enabled auto-merge (squash) May 16, 2024 17:03
@ciarams87 ciarams87 merged commit aa16231 into nginxinc:main May 16, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request release-notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Support ResponseHeaderModifier filter for GRPC Route
5 participants