From 1ac4dacc3b85289198fd4129e9fb84512e16e9e0 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 5 Oct 2021 10:44:07 +0200 Subject: [PATCH] outposts: fix error when comparing ports in docker controller when port mapping is disabled Signed-off-by: Jens Langhammer --- authentik/outposts/controllers/docker.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/authentik/outposts/controllers/docker.py b/authentik/outposts/controllers/docker.py index 4714750c3..fbf4bea98 100644 --- a/authentik/outposts/controllers/docker.py +++ b/authentik/outposts/controllers/docker.py @@ -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: