Skip to content

Add fix to route parentRef internal logic #3418

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

Merged
merged 8 commits into from
May 30, 2025

Conversation

bjee19
Copy link
Contributor

@bjee19 bjee19 commented May 29, 2025

Proposed changes

Internally generate ParentRefs for each listener in the Gateway if a route does not specify a sectionName.

Problem: When a route does not specify a sectionName, it attaches to all attachable listeners on a Gateway. This is a problem internally when we try to bind the route to the listeners where duplicated hostnames between listeners can create AcceptedHostname conflicts and multiple ports on the listeners can overwrite the refStatus.ListenerPort.

Solution: When a route does not specify a sectionName, generate a ParentRef for each listener in the Gateway.

Testing: Manually tested that the scenario reported in #3400 does not occur anymore.

Closes #3400

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.

Fixed bug that occurred when a route's ParentRef does not include a sectionName and the Gateway's listeners have duplicate hostnames. This would cause conflicts when the route tries to attach to all the listeners and falsely trigger validation checks around overlapping routes.

@github-actions github-actions bot added the bug Something isn't working label May 29, 2025
Copy link

codecov bot commented May 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.74%. Comparing base (ae9c118) to head (c84872f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3418      +/-   ##
==========================================
- Coverage   86.82%   86.74%   -0.09%     
==========================================
  Files         127      127              
  Lines       15020    15068      +48     
  Branches       62       62              
==========================================
+ Hits        13041    13070      +29     
- Misses       1830     1846      +16     
- Partials      149      152       +3     

☔ 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.

@sjberman
Copy link
Collaborator

I'd also add a release note that describes this bug

@bjee19 bjee19 changed the title Add fix to parent ref creation logic Add fix to parentRef creation logic May 30, 2025
@bjee19 bjee19 marked this pull request as ready for review May 30, 2025 09:47
@bjee19 bjee19 requested a review from a team as a code owner May 30, 2025 09:47
@bjee19 bjee19 changed the title Add fix to parentRef creation logic Add fix to route parentRef internal logic May 30, 2025
Copy link
Contributor

@salonichf5 salonichf5 left a comment

Choose a reason for hiding this comment

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

🚀

@bjee19 bjee19 force-pushed the bug/fix-observability-policy-conflicting-routes branch 2 times, most recently from 60037d7 to d3002bc Compare May 30, 2025 17:10
@bjee19 bjee19 enabled auto-merge (squash) May 30, 2025 17:23
@bjee19 bjee19 force-pushed the bug/fix-observability-policy-conflicting-routes branch from d3002bc to c84872f Compare May 30, 2025 17:35
@bjee19 bjee19 merged commit cc3c907 into main May 30, 2025
43 checks passed
@bjee19 bjee19 deleted the bug/fix-observability-policy-conflicting-routes branch May 30, 2025 18:25
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working release-notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

ObservabilityPolicy: got TargetConflict error when creating ObservabilityPolicy for two totally seperated applications
3 participants