Skip to content

Conversation

@ciarams87
Copy link
Contributor

Proposed changes

Problem: When routing to an ExternalName service alongside internal services in the same HTTPRoute, NGF incorrectly sets the Host header to the Gateway's hostname instead of the external service's hostname, causing requests to fail.

Solution: Properly set Host header based on ExternalName service hostname.

Testing: Local testing using the updated examples and unit testing

Please focus on (optional): If you any specific areas where you would like reviewers to focus their attention or provide
specific feedback, add them here.

Closes #4187

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.

Support mixed externalname and local services in single route.

@github-actions github-actions bot added bug Something isn't working documentation Improvements or additions to documentation labels Oct 29, 2025
@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 89.65517% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.96%. Comparing base (5c78a60) to head (0ffb7d8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/controller/nginx/config/servers.go 78.57% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4188      +/-   ##
==========================================
- Coverage   85.99%   85.96%   -0.03%     
==========================================
  Files         131      131              
  Lines       14063    14081      +18     
  Branches       35       35              
==========================================
+ Hits        12093    12105      +12     
- Misses       1770     1774       +4     
- Partials      200      202       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ciarams87 ciarams87 marked this pull request as ready for review October 29, 2025 16:14
@ciarams87 ciarams87 requested a review from a team as a code owner October 29, 2025 16:14
Copy link
Contributor

@bjee19 bjee19 left a comment

Choose a reason for hiding this comment

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

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation release-notes

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

NGF does not support mixed external name and local service in the same HTTPRoute

3 participants