summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2024-01-22 10:32:41 -0500
committerGitHub <noreply@github.com>2024-01-22 17:32:41 +0200
commitfc7f7be30248093275e06b76d5f55ad0a8fcad5c (patch)
treec8a7346610c258a57c52ebe7e01141a2539d0470
parent675cbbf24a098dd77481f320bb7073320a446946 (diff)
Improve container detection logic for edit-config. (#16825)
-rwxr-xr-xsystem/edit-config4
1 files changed, 3 insertions, 1 deletions
diff --git a/system/edit-config b/system/edit-config
index 74f3634c3f..3944810d23 100755
--- a/system/edit-config
+++ b/system/edit-config
@@ -112,8 +112,10 @@ check_editor() {
running_in_container() {
[ -e /.dockerenv ] && return 0
[ -e /.dockerinit ] && return 0
- [ -r /proc/1/environ ] && tr '\000' '\n' </proc/1/environ | grep -Eiq '^container=podman' && return 0
+ [ -e /run/.containerenv ] && return 0
+ [ -r /proc/1/environ ] && tr '\000' '\n' </proc/1/environ | grep -Eiq 'container=' && return 0
grep -qF -e /docker/ -e /libpod- /proc/self/cgroup 2>/dev/null && return 0
+ return 1
}
get_docker_command() {