machine: add container detection logging

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-02-08 06:00:01 -05:00
parent d70dfaeebd
commit 645f0c9acf
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 6 additions and 0 deletions

View File

@ -579,6 +579,9 @@ class Machine:
self.inside_container = True
virt_type = "container"
virt_id = ct
logging.info(
f"Container detected via cgroup: {ct}"
)
break
except Exception:
logging.exception(f"Error reading {CGROUP_PATH}")
@ -599,6 +602,9 @@ class Machine:
os.path.exists("/.dockerinit")
):
virt_id = "docker"
logging.info(
f"Container detected via sched: {virt_id}"
)
except Exception:
logging.exception(f"Error reading {SCHED_PATH}")
return {