From b47b73f5820e6ae2b428a3e36d3d9c2fe9076dc8 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Wed, 21 Jun 2023 13:59:41 +0000 Subject: T5304: Container add volume bind propagation option set container name c1 volume myvlm propagation rshared --- interface-definitions/container.xml.in | 36 ++++++++++++++++++++++++++++++++++ src/conf_mode/container.py | 3 ++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/interface-definitions/container.xml.in b/interface-definitions/container.xml.in index 6651fc642..d36b34941 100644 --- a/interface-definitions/container.xml.in +++ b/interface-definitions/container.xml.in @@ -334,6 +334,42 @@ rw + + + Volume bind propagation + + shared slave private rshared rslave rprivate + + + shared + Sub-mounts of the original mount are exposed to replica mounts + + + slave + Allow replica mount to see sub-mount from the original mount but not vice versa + + + private + Sub-mounts within a mount are not visible to replica mounts or the original mount + + + rshared + Allows sharing of mount points and their nested mount points between both the original and replica mounts + + + rslave + Allows mount point and their nested mount points between original an replica mounts + + + rprivate + No mount points within original or replica mounts in any direction + + + (shared|slave|private|rshared|rslave|rprivate) + + + rprivate + diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py index aceb27fb0..6198bb65f 100755 --- a/src/conf_mode/container.py +++ b/src/conf_mode/container.py @@ -321,7 +321,8 @@ def generate_run_arguments(name, container_config): svol = vol_config['source'] dvol = vol_config['destination'] mode = vol_config['mode'] - volume += f' --volume {svol}:{dvol}:{mode}' + prop = vol_config['propagation'] + volume += f' --volume {svol}:{dvol}:{mode},{prop}' container_base_cmd = f'--detach --interactive --tty --replace {cap_add} ' \ f'--memory {memory}m --shm-size {shared_memory}m --memory-swap 0 --restart {restart} ' \ -- cgit v1.2.3