Skip to content

Commit

Permalink
Merge pull request #2051 from sever-sever/T5304
Browse files Browse the repository at this point in the history
T5304: Container add volume bind propagation option
  • Loading branch information
c-po authored Jun 27, 2023
2 parents 90c0c2c + b47b73f commit 6a2ddc4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
36 changes: 36 additions & 0 deletions interface-definitions/container.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,42 @@
</properties>
<defaultValue>rw</defaultValue>
</leafNode>
<leafNode name="propagation">
<properties>
<help>Volume bind propagation</help>
<completionHelp>
<list>shared slave private rshared rslave rprivate</list>
</completionHelp>
<valueHelp>
<format>shared</format>
<description>Sub-mounts of the original mount are exposed to replica mounts</description>
</valueHelp>
<valueHelp>
<format>slave</format>
<description>Allow replica mount to see sub-mount from the original mount but not vice versa</description>
</valueHelp>
<valueHelp>
<format>private</format>
<description>Sub-mounts within a mount are not visible to replica mounts or the original mount</description>
</valueHelp>
<valueHelp>
<format>rshared</format>
<description>Allows sharing of mount points and their nested mount points between both the original and replica mounts</description>
</valueHelp>
<valueHelp>
<format>rslave</format>
<description>Allows mount point and their nested mount points between original an replica mounts</description>
</valueHelp>
<valueHelp>
<format>rprivate</format>
<description>No mount points within original or replica mounts in any direction</description>
</valueHelp>
<constraint>
<regex>(shared|slave|private|rshared|rslave|rprivate)</regex>
</constraint>
</properties>
<defaultValue>rprivate</defaultValue>
</leafNode>
</children>
</tagNode>
</children>
Expand Down
3 changes: 2 additions & 1 deletion src/conf_mode/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -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} ' \
Expand Down

0 comments on commit 6a2ddc4

Please sign in to comment.