outposts: check if docker ports should be mapped before comparing ports

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-04-07 17:30:33 +02:00
parent 07267ac425
commit e2f0a76309
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ class DockerController(BaseController):
# {'HostIp': '::', 'HostPort': '389'} # {'HostIp': '::', 'HostPort': '389'}
# ]} # ]}
# If no ports are mapped (either mapping disabled, or host network) # If no ports are mapped (either mapping disabled, or host network)
if not container.ports: if not container.ports or not self.outpost.config.docker_map_ports:
return False 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()}"