summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-09-09 09:25:00 +0200
committerGitHub <noreply@github.com>2023-09-09 09:25:00 +0200
commitf494325bfde2ba9ff708fa00a7582a5fb6182486 (patch)
tree4ab09d9b0f8d1bc82949c33c488f2645f2252c8b
parent7f6624f5a6f8bd1749b54103ea5ec9f010adf778 (diff)
parent79a46675b031a4edc0ea925a45066077c0804b9b (diff)
downloadvyos-1x-f494325bfde2ba9ff708fa00a7582a5fb6182486.tar.gz
vyos-1x-f494325bfde2ba9ff708fa00a7582a5fb6182486.zip
Merge pull request #2228 from hlhc/fix/env-replaced-by-label
container: T5563 Fix environment replaced by label
-rwxr-xr-xsrc/conf_mode/container.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py
index 46eb10714..daad9186e 100755
--- a/src/conf_mode/container.py
+++ b/src/conf_mode/container.py
@@ -274,10 +274,10 @@ def generate_run_arguments(name, container_config):
env_opt += f" --env \"{k}={v['value']}\""
# Check/set label options "--label foo=bar"
- env_opt = ''
+ label = ''
if 'label' in container_config:
for k, v in container_config['label'].items():
- env_opt += f" --label \"{k}={v['value']}\""
+ label += f" --label \"{k}={v['value']}\""
hostname = ''
if 'host_name' in container_config:
@@ -314,7 +314,7 @@ def generate_run_arguments(name, container_config):
container_base_cmd = f'--detach --interactive --tty --replace {cap_add} ' \
f'--memory {memory}m --shm-size {shared_memory}m --memory-swap 0 --restart {restart} ' \
- f'--name {name} {hostname} {device} {port} {volume} {env_opt}'
+ f'--name {name} {hostname} {device} {port} {volume} {env_opt} {label}'
entrypoint = ''
if 'entrypoint' in container_config: