From 6316421a758c1b19de29d3881d1fbb0bb4a9e0c0 Mon Sep 17 00:00:00 2001 From: Ian Falatik Date: Fri, 4 Oct 2024 17:16:56 +0200 Subject: [PATCH] Fix `labels` section being defined twice in `docker-compose.yml` when `labels` is a dictionary. --- CHANGELOG.md | 5 +++++ galaxy.yml | 2 +- roles/project_deployment/templates/docker-compose.yml.j2 | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d633dc..8b14a50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # CHANGELOG +## v3.0.4 + +### project_deployment +- Fix `labels` section being defined twice in `docker-compose.yml` when `labels` is a dictionary. + ## v3.0.3 ### project_deployment diff --git a/galaxy.yml b/galaxy.yml index 9b3bc5a..12911f0 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -8,7 +8,7 @@ namespace: ifalatik name: docker # The version of the collection. Must be compatible with semantic versioning -version: "3.0.3" +version: "3.0.4" # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md diff --git a/roles/project_deployment/templates/docker-compose.yml.j2 b/roles/project_deployment/templates/docker-compose.yml.j2 index 3fb6e7c..f997a3d 100644 --- a/roles/project_deployment/templates/docker-compose.yml.j2 +++ b/roles/project_deployment/templates/docker-compose.yml.j2 @@ -119,8 +119,7 @@ networks: {% for key, value in network[ 'labels' ].items() %} {{ key }}: {{ value }} {% endfor %} -{% endif %} -{% if network[ 'labels' ] | length > 0 %} +{% elif network[ 'labels' ] | length > 0 %} labels: {% for network_label in network[ 'labels' ] %} - {{ network_label }}