From 5d1ef34f17d622d215576ac9b10ad7d088a4948c Mon Sep 17 00:00:00 2001 From: cociweb Date: Wed, 14 Jun 2023 23:40:46 +0200 Subject: [PATCH] Fix propagation mode of mounts to allow Ha-Core to start (#4374) * Fix propagation mode of mounts to allow Ha-Core to start Change the mount propagation mode from SLAVE to RSLAVE in case of /media and /share * Check /share and /media to use RSLAVE as a propagation mode of mount * Fix mount propagation mode of /share and /media * Check /share and /media for rslave propagation mode --- supervisor/docker/addon.py | 4 ++-- supervisor/docker/homeassistant.py | 4 ++-- supervisor/resolution/checks/docker_config.py | 2 +- tests/docker/test_addon.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/supervisor/docker/addon.py b/supervisor/docker/addon.py index eaeaa3e16..3225072e3 100644 --- a/supervisor/docker/addon.py +++ b/supervisor/docker/addon.py @@ -387,7 +387,7 @@ class DockerAddon(DockerInterface): source=self.sys_config.path_extern_share.as_posix(), target="/share", read_only=addon_mapping[MAP_SHARE], - propagation=PropagationMode.SLAVE.value, + propagation=PropagationMode.RSLAVE.value, ) ) @@ -398,7 +398,7 @@ class DockerAddon(DockerInterface): source=self.sys_config.path_extern_media.as_posix(), target="/media", read_only=addon_mapping[MAP_MEDIA], - propagation=PropagationMode.SLAVE.value, + propagation=PropagationMode.RSLAVE.value, ) ) diff --git a/supervisor/docker/homeassistant.py b/supervisor/docker/homeassistant.py index b08e175d4..83b1c99cb 100644 --- a/supervisor/docker/homeassistant.py +++ b/supervisor/docker/homeassistant.py @@ -97,14 +97,14 @@ class DockerHomeAssistant(DockerInterface): source=self.sys_config.path_extern_share.as_posix(), target="/share", read_only=False, - propagation=PropagationMode.SLAVE.value, + propagation=PropagationMode.RSLAVE.value, ), Mount( type=MountType.BIND.value, source=self.sys_config.path_extern_media.as_posix(), target="/media", read_only=False, - propagation=PropagationMode.SLAVE.value, + propagation=PropagationMode.RSLAVE.value, ), # Configuration audio Mount( diff --git a/supervisor/resolution/checks/docker_config.py b/supervisor/resolution/checks/docker_config.py index 746720a58..71cde6008 100644 --- a/supervisor/resolution/checks/docker_config.py +++ b/supervisor/resolution/checks/docker_config.py @@ -12,7 +12,7 @@ from .base import CheckBase def _check_container(container: DockerInterface) -> bool: """Return true if container has a config issue.""" return any( - mount.get("Propagation") != PropagationMode.SLAVE.value + mount.get("Propagation") != PropagationMode.RSLAVE.value for mount in container.meta_mounts if mount.get("Destination") in ["/media", "/share"] ) diff --git a/tests/docker/test_addon.py b/tests/docker/test_addon.py index 570ad357f..68327fda0 100644 --- a/tests/docker/test_addon.py +++ b/tests/docker/test_addon.py @@ -121,7 +121,7 @@ def test_addon_map_folder_defaults( source=coresys.config.path_extern_media.as_posix(), target="/media", read_only=True, - propagation="slave", + propagation="rslave", ) in docker_addon.mounts ) @@ -133,7 +133,7 @@ def test_addon_map_folder_defaults( source=coresys.config.path_extern_share.as_posix(), target="/share", read_only=True, - propagation="slave", + propagation="rslave", ) in docker_addon.mounts )