Skip to content

Conversation

@bjee19
Copy link
Contributor

@bjee19 bjee19 commented Nov 10, 2025

Cherry-pick #4178. Fix bug where user mounted files were being removed by agent.

Problem: User mounted files are being removed by nginx agent.

Solution: Mark user mounted files as unmanaged so nginx agent doesn't remove them. To do so we use agent's UpdateOverview function to get all files referenced in the nginx conf. We compare that with the user added volumeMounts and mark any files that were user mounted as unmanaged, ensuring nginx agent doesn't remove them.

Testing: Added unit tests and manual testing.

Closes

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 bug where user mounted files were being removed by NGINX. 

Fix bug where user mounted files were being removed by agent.

Problem: User mounted files are being removed by nginx agent.

Solution: Mark user mounted files as unmanaged so nginx agent doesn't remove them. To do so we use agent's UpdateOverview function to get all files referenced in the nginx conf. We compare that with the user added volumeMounts and mark any files that were user mounted as unmanaged, ensuring nginx agent doesn't remove them.

Testing: Added unit tests and manual testing.
@bjee19 bjee19 requested a review from a team as a code owner November 10, 2025 18:24
@github-actions github-actions bot added the bug Something isn't working label Nov 10, 2025
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.16%. Comparing base (e7af3a5) to head (2e6dbbc).
⚠️ Report is 1 commits behind head on release-2.2.

Additional details and impacted files
@@               Coverage Diff               @@
##           release-2.2    #4246      +/-   ##
===============================================
- Coverage        86.17%   86.16%   -0.02%     
===============================================
  Files              131      131              
  Lines            14282    14313      +31     
  Branches            74       74              
===============================================
+ Hits             12308    12333      +25     
- Misses            1773     1777       +4     
- Partials           201      203       +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.

@bjee19 bjee19 enabled auto-merge (squash) November 10, 2025 18:31
@bjee19 bjee19 merged commit 59fd539 into release-2.2 Nov 10, 2025
62 checks passed
@bjee19 bjee19 deleted the bug/mounted-files-agent branch November 10, 2025 18:55
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric Nov 10, 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.

4 participants