Allow null values for labels and ports, convert to empty lists

This commit is contained in:
Corbin Bartsch 2023-10-29 10:42:07 -04:00 committed by Corbin Bartsch
parent df476f1c61
commit d68d96015e
Signed by: coredotbin
GPG Key ID: B03E030E4322E9D5

View File

@ -72,12 +72,19 @@ services:
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% if container.labels is defined %} {% if container.labels is defined %}
{% if container.labels is none %}
labels: []
{% else %}
labels: labels:
{% for label in container.labels %} {% for label in container.labels %}
- {{ label }} - {{ label }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endif %}
{% if container.ports is defined %} {% if container.ports is defined %}
{% if container.ports is none %}
ports: []
{% else %}
ports: ports:
{% for port in container.ports %} {% for port in container.ports %}
- {{ port }} - {{ port }}