-
Notifications
You must be signed in to change notification settings - Fork 6.3k
fix(edit-config): ignore container variable inherited from /etc/profile #21505
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(edit-config): ignore container variable inherited from /etc/profile #21505
Conversation
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.
No issues found across 1 file
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.
Pull request overview
This PR fixes a bug where the edit-config script fails in LXC containers due to an inherited container environment variable from /etc/profile being mistakenly treated as a command.
Key Changes:
- Preserve caller-provided
containervariable before sourcing/etc/profile - Restore the original value after sourcing, or unset it if it wasn't initially set
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
…le (netdata#21505) Co-authored-by: Copilot <[email protected]> (cherry picked from commit 17bfcfe)
…le (netdata#21505) Co-authored-by: Copilot <[email protected]> (cherry picked from commit 17bfcfe)
…le (#21505) Co-authored-by: Copilot <[email protected]> (cherry picked from commit 17bfcfe)
Summary
Fixes: #21504
Issue:
edit-configsources/etc/profile, which may define a container environment variable (e.g.container=lxcin LXC environments).If
containeris not explicitly set by the caller, this inherited value is later treated as a command, causing failures.Fix:
Preserve the container variable only if it was explicitly set by the caller before sourcing
/etc/profile.Test Plan
Additional Information
For users: How does this change affect me?
Summary by cubic
Prevent edit-config from using a container value inherited from /etc/profile unless the caller set it. This avoids failures where inherited values (e.g., container=lxc) are treated as commands.
Written for commit bdae96f. Summary will update automatically on new commits.