summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas Vollmar <nvo@scaling.ch>2024-05-17 08:59:55 +0200
committerNicolas Vollmar <nvo@scaling.ch>2024-05-17 10:25:30 +0200
commitf5051de4fc034bd95677ef142423e59eae47cd2f (patch)
tree87ee588b898fb416ec03d76a4de354a66e90e5f7 /src
parent240f199cdfadbc12ce713dae74c8db3af44a398c (diff)
downloadvyos-1x-f5051de4fc034bd95677ef142423e59eae47cd2f.tar.gz
vyos-1x-f5051de4fc034bd95677ef142423e59eae47cd2f.zip
T6358: Add config option for host process namespace
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/container.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py
index c3b661ac5..91a10e891 100755
--- a/src/conf_mode/container.py
+++ b/src/conf_mode/container.py
@@ -329,9 +329,13 @@ def generate_run_arguments(name, container_config):
prop = vol_config['propagation']
volume += f' --volume {svol}:{dvol}:{mode},{prop}'
+ host_pid = ''
+ if 'allow_host_pid' in container_config:
+ host_pid = '--pid host'
+
container_base_cmd = f'--detach --interactive --tty --replace {capabilities} ' \
f'--memory {memory}m --shm-size {shared_memory}m --memory-swap 0 --restart {restart} ' \
- f'--name {name} {hostname} {device} {port} {volume} {env_opt} {label} {uid}'
+ f'--name {name} {hostname} {device} {port} {volume} {env_opt} {label} {uid} {host_pid}'
entrypoint = ''
if 'entrypoint' in container_config: