Skip to content

Commit

Permalink
Merge pull request #2229 from c-po/sagitta
Browse files Browse the repository at this point in the history
container: T5563 Fix environment replaced by label
  • Loading branch information
sever-sever authored Sep 9, 2023
2 parents cfe1dbd + ed47ac6 commit b238356
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/conf_mode/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b238356

Please sign in to comment.