outposts: fix error when comparing ports in docker controller when port mapping is disabled

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-10-05 10:44:07 +02:00
parent bcf7e162a4
commit 1ac4dacc3b
1 changed files with 3 additions and 0 deletions

View File

@ -76,6 +76,9 @@ class DockerController(BaseController):
# {'HostIp': '0.0.0.0', 'HostPort': '389'}, # {'HostIp': '0.0.0.0', 'HostPort': '389'},
# {'HostIp': '::', 'HostPort': '389'} # {'HostIp': '::', 'HostPort': '389'}
# ]} # ]}
# If no ports are mapped (either mapping disabled, or host network)
if not container.ports:
return False
for port in self.deployment_ports: for port in self.deployment_ports:
key = f"{port.inner_port or port.port}/{port.protocol.lower()}" key = f"{port.inner_port or port.port}/{port.protocol.lower()}"
if key not in container.ports: if key not in container.ports: