diff options
| author | l0crian1 <ryan.claridge13@gmail.com> | 2025-09-16 11:01:46 -0400 |
|---|---|---|
| committer | l0crian1 <ryan.claridge13@gmail.com> | 2025-09-16 11:01:46 -0400 |
| commit | 5c5d3a6b839b2a612fefb7d5f0443b80ceb156d0 (patch) | |
| tree | f3b782bdd56450004886ddc06158b716259ae5f9 /src | |
| parent | 8b0c9b7f7d54c876e12552296a4967f24d09afe9 (diff) | |
| download | vyos-1x-5c5d3a6b839b2a612fefb7d5f0443b80ceb156d0.tar.gz vyos-1x-5c5d3a6b839b2a612fefb7d5f0443b80ceb156d0.zip | |
container: T7681: fix multiple name servers
- Fixed error with multiple name servers missing space between --dns options
Diffstat (limited to 'src')
| -rwxr-xr-x | src/conf_mode/container.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py index 8950f857e..4fe1e432c 100755 --- a/src/conf_mode/container.py +++ b/src/conf_mode/container.py @@ -443,10 +443,14 @@ def generate_run_arguments(name, container_config, host_ident): if 'allow_host_pid' in container_config: host_pid = '--pid host' - name_server = '' + name_server = [] if 'name_server' in container_config: for ns in container_config['name_server']: - name_server += f'--dns {ns}' + name_server.append(f'--dns {ns}') + if name_server: + name_server = ' '.join(name_server) + else: + name_server = '' container_base_cmd = f'--detach --interactive --tty --replace {capabilities} {privileged} --cpus {cpu_quota} {sysctl_opt} ' \ f'--memory {memory}m --shm-size {shared_memory}m --memory-swap 0 --restart {restart} --log-driver={log_driver} ' \ |
