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 a515afae0b
commit 05b587ae44
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': '::', '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:
key = f"{port.inner_port or port.port}/{port.protocol.lower()}"
if key not in container.ports: