Open phvalguima opened 1 month ago
@phvalguima not sure if this is similar to what you're looking for, but HPC does have a library for detecting if your machine charm is currently running within a container: https://github.com/charmed-hpc/hpc-libs/blob/main/lib/charms/hpc_libs/v0/is_container.py
We kept it systemd agnostic however - e.g. didn't include it in the systemd charm library - as some of our routines/applications won't work if inside an LXD container but aren't managed directly by systemd.
Can we add support for
systemd-detect-virt
on oursystemd
lib?That is important, e.g. when we want to use sysctl lib and some of the options may be applicable, but others cannot.
Proposal: