From d68d96015e33c78267960fbf64e5aefb7ee3754b Mon Sep 17 00:00:00 2001 From: Corbin Bartsch Date: Sun, 29 Oct 2023 10:42:07 -0400 Subject: [PATCH] Allow null values for labels and ports, convert to empty lists --- templates/docker-compose.yml.j2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index e2156c6..684e5b7 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -72,12 +72,19 @@ services: {% endfor %} {% endif %} {% if container.labels is defined %} +{% if container.labels is none %} + labels: [] +{% else %} labels: {% for label in container.labels %} - {{ label }} {% endfor %} {% endif %} +{% endif %} {% if container.ports is defined %} +{% if container.ports is none %} + ports: [] +{% else %} ports: {% for port in container.ports %} - {{ port }}