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
This commit is contained in:
cociweb 2023-06-14 23:40:46 +02:00 committed by GitHub
parent 9504eff889
commit 5d1ef34f17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -387,7 +387,7 @@ class DockerAddon(DockerInterface):
source=self.sys_config.path_extern_share.as_posix(), source=self.sys_config.path_extern_share.as_posix(),
target="/share", target="/share",
read_only=addon_mapping[MAP_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(), source=self.sys_config.path_extern_media.as_posix(),
target="/media", target="/media",
read_only=addon_mapping[MAP_MEDIA], read_only=addon_mapping[MAP_MEDIA],
propagation=PropagationMode.SLAVE.value, propagation=PropagationMode.RSLAVE.value,
) )
) )

View File

@ -97,14 +97,14 @@ class DockerHomeAssistant(DockerInterface):
source=self.sys_config.path_extern_share.as_posix(), source=self.sys_config.path_extern_share.as_posix(),
target="/share", target="/share",
read_only=False, read_only=False,
propagation=PropagationMode.SLAVE.value, propagation=PropagationMode.RSLAVE.value,
), ),
Mount( Mount(
type=MountType.BIND.value, type=MountType.BIND.value,
source=self.sys_config.path_extern_media.as_posix(), source=self.sys_config.path_extern_media.as_posix(),
target="/media", target="/media",
read_only=False, read_only=False,
propagation=PropagationMode.SLAVE.value, propagation=PropagationMode.RSLAVE.value,
), ),
# Configuration audio # Configuration audio
Mount( Mount(

View File

@ -12,7 +12,7 @@ from .base import CheckBase
def _check_container(container: DockerInterface) -> bool: def _check_container(container: DockerInterface) -> bool:
"""Return true if container has a config issue.""" """Return true if container has a config issue."""
return any( return any(
mount.get("Propagation") != PropagationMode.SLAVE.value mount.get("Propagation") != PropagationMode.RSLAVE.value
for mount in container.meta_mounts for mount in container.meta_mounts
if mount.get("Destination") in ["/media", "/share"] if mount.get("Destination") in ["/media", "/share"]
) )

View File

@ -121,7 +121,7 @@ def test_addon_map_folder_defaults(
source=coresys.config.path_extern_media.as_posix(), source=coresys.config.path_extern_media.as_posix(),
target="/media", target="/media",
read_only=True, read_only=True,
propagation="slave", propagation="rslave",
) )
in docker_addon.mounts in docker_addon.mounts
) )
@ -133,7 +133,7 @@ def test_addon_map_folder_defaults(
source=coresys.config.path_extern_share.as_posix(), source=coresys.config.path_extern_share.as_posix(),
target="/share", target="/share",
read_only=True, read_only=True,
propagation="slave", propagation="rslave",
) )
in docker_addon.mounts in docker_addon.mounts
) )