Skip to content
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

Improve container detection logic for edit-config. #16825

Merged
merged 1 commit into from Jan 22, 2024

Conversation

Ferroin
Copy link
Member

@Ferroin Ferroin commented Jan 22, 2024

Summary
  • Check for /run/.containerenv, which is used by modern versions of Podman and some other OCI stacks to signal that the environment is a container.
  • Relax the PID 1 environment checking to not require container to be set to podman (some images override it), and not require it to be the first item in the list of environment variables (it will often not be).
  • Explicitly return a non-zero exit status if no signs of being in a container are detected.
Test Plan

This needs to be manually tested in affected environments to confirm it works.

Testing should be as simple as copying the version of the edit-config script from the PR branch to the expected location in the test environment and running it there.

Additional Information

Fixes: #16819

@github-actions github-actions bot added the area/packaging Packaging and operating systems support label Jan 22, 2024
@Ferroin Ferroin marked this pull request as ready for review January 22, 2024 14:53
@ilyam8 ilyam8 merged commit fc7f7be into netdata:master Jan 22, 2024
133 checks passed
@Ferroin Ferroin deleted the fix-edit-config-container-handling branch January 22, 2024 16:15
stelfrag pushed a commit to stelfrag/netdata that referenced this pull request Jan 31, 2024
@stelfrag stelfrag mentioned this pull request Jan 31, 2024
tkatsoulas pushed a commit that referenced this pull request Feb 6, 2024
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]: Podman Container not Supported
2 participants