FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(edit-config): ignore container variable inherited from /etc/profile by ilyam8 · Pull Request #21505 · netdata/netdata · GitHub

fix(edit-config): ignore container variable inherited from /etc/profile - #21505

Merged
ilyam8 merged 2 commits into
netdata:masterfrom
ilyam8:fix-edit-config-ignore-container
Dec 27, 2025
Merged

fix(edit-config): ignore container variable inherited from /etc/profile#21505
ilyam8 merged 2 commits into
netdata:masterfrom
ilyam8:fix-edit-config-ignore-container

Conversation

ilyam8 commented Dec 27, 2025
edited by cubic-dev-ai Bot
Loading

Copy link
Copy Markdown
Member
Summary

Fixes: #21504

  • Issue:
    edit-config sources /etc/profile, which may define a container environment variable (e.g. container=lxc in LXC environments).

    If container is 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.

  • Bug Fixes
    • Save caller-provided container before sourcing /etc/profile.
    • Restore it after sourcing; otherwise unset container.

Written for commit bdae96f. Summary will update automatically on new commits.

ilyam8 requested a review from a team as a code owner December 27, 2025 11:24
github-actions Bot added the area/packaging Packaging and operating systems support label Dec 27, 2025
ilyam8 requested review from Copilot and removed request for a team December 27, 2025 11:24

cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

No issues found across 1 file

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 container variable 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.

Comment thread system/edit-config Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ilyam8 merged commit 17bfcfe into netdata:master Dec 27, 2025
115 checks passed
ilyam8 deleted the fix-edit-config-ignore-container branch December 27, 2025 14:57
stelfrag pushed a commit to stelfrag/netdata that referenced this pull request Jan 9, 2026
…le (netdata#21505)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit 17bfcfe)
stelfrag pushed a commit to stelfrag/netdata that referenced this pull request Jan 9, 2026
…le (netdata#21505)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit 17bfcfe)
stelfrag mentioned this pull request Jan 9, 2026
Ferroin pushed a commit that referenced this pull request Jan 12, 2026
…le (#21505)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit 17bfcfe)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/packaging Packaging and operating systems support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: edit-config container misdetection

3 participants


Back | FazBrowse Home | New Git URL