mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-25 18:16:32 +00:00
Detect lxc (#1754)
* Detect LXC on health check * fix lint * Update supervisor/core.py Co-authored-by: Franck Nijhof <git@frenck.dev> * fix black Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
18e3eacd7f
commit
960b00d85a
@ -48,6 +48,12 @@ class Core(CoreSysAttributes):
|
||||
"Docker version %s is not supported by Supervisor!",
|
||||
self.sys_docker.info.version,
|
||||
)
|
||||
elif self.sys_docker.info.inside_lxc:
|
||||
self.healthy = False
|
||||
_LOGGER.critical(
|
||||
"Detected Docker running inside LXC. Running Home Assistant with the Supervisor on LXC is not supported!"
|
||||
)
|
||||
|
||||
self.sys_docker.info.check_requirements()
|
||||
|
||||
# Check if system is healthy
|
||||
|
@ -2,6 +2,7 @@
|
||||
from contextlib import suppress
|
||||
from ipaddress import IPv4Address
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import attr
|
||||
@ -46,6 +47,11 @@ class DockerInfo:
|
||||
|
||||
return version_local >= version_min
|
||||
|
||||
@property
|
||||
def inside_lxc(self) -> bool:
|
||||
"""Return True if the docker run inside lxc."""
|
||||
return Path("/dev/lxd/sock").exists()
|
||||
|
||||
def check_requirements(self) -> None:
|
||||
"""Show wrong configurations."""
|
||||
if self.storage != "overlay2":
|
||||
|
Loading…
x
Reference in New Issue
Block a user