Skip to content

Conversation

@sjberman
Copy link
Collaborator

Cherrypick of #4481

Problem: When hostNetwork was enabled, the data plane pod would connect and give us its hostname, which was the name of the node instead of the pod. This would cause issues internally with both tracking and acquiring the pod's owner so we know which config to send to it.

Solution: Add the owner's name and type via labels in the agent config. These labels are then sent to the control plane when an agent connects, and can be used to determine which configuration to send. Updated all trackin to use the UUID instead of pod name.

Testing: Enabling hostNetwork now allows the nginx pod to connect.

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.

Fix an issue where nginx pod could not connect to control plane when hostnetwork is enabled.

Problem: When hostNetwork was enabled, the data plane pod would connect and give us its hostname, which was the name of the node instead of the pod. This would cause issues internally with both tracking and acquiring the pod's owner so we know which config to send to it.

Solution: Add the owner's name and type via labels in the agent config. These labels are then sent to the control plane when an agent connects, and can be used to determine which configuration to send. Updated all trackin to use the UUID instead of pod name.
@sjberman sjberman requested a review from a team as a code owner December 17, 2025 20:08
@github-actions github-actions bot added the bug Something isn't working label Dec 17, 2025
@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

❌ Patch coverage is 80.16529% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.20%. Comparing base (f599851) to head (f755b49).
⚠️ Report is 1 commits behind head on release-2.3.

Files with missing lines Patch % Lines
internal/controller/nginx/agent/command.go 77.31% 19 Missing and 3 partials ⚠️
internal/controller/provisioner/provisioner.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           release-2.3    #4483      +/-   ##
===============================================
+ Coverage        86.18%   86.20%   +0.01%     
===============================================
  Files              132      132              
  Lines            14560    14570      +10     
  Branches            35       35              
===============================================
+ Hits             12549    12560      +11     
- Misses            1795     1798       +3     
+ Partials           216      212       -4     

☔ 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 sjberman enabled auto-merge (squash) December 17, 2025 20:20
@sjberman sjberman merged commit efc06dd into release-2.3 Dec 17, 2025
60 of 61 checks passed
@sjberman sjberman deleted the fix/hostname branch December 17, 2025 20:38
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric Dec 17, 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.

5 participants