mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-27 02:56:31 +00:00
Check supervisor docker permission (#1285)
* Check supervisor docker permission * Update log message
This commit is contained in:
parent
db9d0f2639
commit
c60d4bda92
@ -42,6 +42,13 @@ class DockerInterface(CoreSysAttributes):
|
|||||||
return {}
|
return {}
|
||||||
return self._meta.get("Config", {})
|
return self._meta.get("Config", {})
|
||||||
|
|
||||||
|
@property
|
||||||
|
def meta_host(self) -> Dict[str, Any]:
|
||||||
|
"""Return meta data of configuration for host."""
|
||||||
|
if not self._meta:
|
||||||
|
return {}
|
||||||
|
return self._meta.get("HostConfig", {})
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def meta_labels(self) -> Dict[str, str]:
|
def meta_labels(self) -> Dict[str, str]:
|
||||||
"""Return meta data of labels for container/image."""
|
"""Return meta data of labels for container/image."""
|
||||||
|
@ -26,6 +26,11 @@ class DockerSupervisor(DockerInterface, CoreSysAttributes):
|
|||||||
"""Return IP address of this container."""
|
"""Return IP address of this container."""
|
||||||
return self.sys_docker.network.supervisor
|
return self.sys_docker.network.supervisor
|
||||||
|
|
||||||
|
@property
|
||||||
|
def privileged(self) -> bool:
|
||||||
|
"""Return True if the container run with Privileged."""
|
||||||
|
return self.meta_host.get("Privileged", False)
|
||||||
|
|
||||||
def _attach(self, tag: str) -> None:
|
def _attach(self, tag: str) -> None:
|
||||||
"""Attach to running docker container.
|
"""Attach to running docker container.
|
||||||
|
|
||||||
|
@ -41,6 +41,12 @@ class Supervisor(CoreSysAttributes):
|
|||||||
with suppress(DockerAPIError):
|
with suppress(DockerAPIError):
|
||||||
await self.instance.cleanup()
|
await self.instance.cleanup()
|
||||||
|
|
||||||
|
# Check privileged mode
|
||||||
|
if not self.instance.privileged:
|
||||||
|
_LOGGER.error(
|
||||||
|
"Supervisor does not run in Privileged mode. Hassio runs with limited functionality!"
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ip_address(self) -> IPv4Address:
|
def ip_address(self) -> IPv4Address:
|
||||||
"""Return IP of Supervisor instance."""
|
"""Return IP of Supervisor instance."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user