-
Notifications
You must be signed in to change notification settings - Fork 140
Fix bug where user mounted files were being removed by agent #4178
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
base: main
Are you sure you want to change the base?
Conversation
|
Will add more details on manual testing below, then will mark PR as ready to review. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4178 +/- ##
=======================================
Coverage 85.99% 86.00%
=======================================
Files 131 131
Lines 14063 14144 +81
Branches 35 35
=======================================
+ Hits 12093 12164 +71
- Misses 1770 1775 +5
- Partials 200 205 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
With these yamls: And a modified NginxProxy: I've verified that the certs are able to be mounted. (that tls key is the same we use in our public examples, not a real secret). |
|
@ciarams87 and other reviewers, one thing to note is if a user is to add a volumeMount that is an existing directory / other nginx conf files are in it, those will be marked as unmanaged and will make agent fail to startup (I tried With our current constraints, I can't think of a way around this, so I think it is fine to require users to mount their files into a new directory. Any thoughts? |
3637ed2 to
6981901
Compare
@bjee19 So That makes a lot of sense, and we should absolutely require users mount their files into a new directory. We should clearly document that new volume mounts cannot conflict with our internal volume mounts and folder structure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
yep |
| vm := []v1.VolumeMount{} | ||
| if gw.EffectiveNginxProxy != nil && | ||
| gw.EffectiveNginxProxy.Kubernetes != nil && | ||
| gw.EffectiveNginxProxy.Kubernetes.Deployment != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could have volume mounts on a DaemonSet as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job 🥳
Proposed changes
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 #3776
Checklist
Before creating a PR, run through this checklist and mark each as complete.
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.