-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix K3S_DATA_DIR when running as non-root user #11378
base: master
Are you sure you want to change the base?
Conversation
When running the generated kill and uninstall scripts, the environment variable `K3S_DATA_DIR` got lost, because `sudo` by default doesn't preserve the environment. This is fixed by adding the `--preserve-env` flag. Signed-off-by: Reinhard Nägele <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #11378 +/- ##
==========================================
- Coverage 46.73% 41.52% -5.21%
==========================================
Files 179 179
Lines 18600 18600
==========================================
- Hits 8693 7724 -969
- Misses 8553 9677 +1124
+ Partials 1354 1199 -155
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks for the fix! Can you open an issue describing the problem this fixes, so our QA team can validate that the issue is resolved by this change? |
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.
I'd prefer to pass through only this one necessary env var, instead of passing through ALL of them.
Co-authored-by: Brad Davidson <[email protected]> Signed-off-by: Reinhard Nägele <[email protected]>
Co-authored-by: Brad Davidson <[email protected]> Signed-off-by: Reinhard Nägele <[email protected]>
Proposed Changes
When running the generated kill and uninstall scripts as non-root user, the environment variable
K3S_DATA_DIR
got lost, becausesudo
by default doesn't preserve the environment. This is fixed by adding the--preserve-env
flag.Types of Changes
Bugfix
Verification
K3S_DATA_DIR
.k3s-uninstall.sh
script as non-root user and check the log output.$K3S_DATA_DIR
directory got cleaned.Fixes: #11386