From 5fd408ca8232102ca32a2f13b6c6889e03193de0 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 4 Jul 2021 12:32:55 +0200 Subject: [PATCH] outposts: fix docker controller not checking ports correctly Signed-off-by: Jens Langhammer --- authentik/outposts/controllers/docker.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/authentik/outposts/controllers/docker.py b/authentik/outposts/controllers/docker.py index 5f0d71d94..f5544311a 100644 --- a/authentik/outposts/controllers/docker.py +++ b/authentik/outposts/controllers/docker.py @@ -63,14 +63,17 @@ class DockerController(BaseController): # When the container isn't running, the API doesn't report any port mappings if container.status != "running": return False - # {'6379/tcp': [{'HostIp': '127.0.0.1', 'HostPort': '6379'}]} + # {'3389/tcp': [ + # {'HostIp': '0.0.0.0', 'HostPort': '389'}, + # {'HostIp': '::', 'HostPort': '389'} + # ]} for port in self.deployment_ports: key = f"{port.inner_port or port.port}/{port.protocol.lower()}" if key not in container.ports: return True host_matching = False for host_port in container.ports[key]: - host_matching = host_port.get("HostPort") == port.port + host_matching = host_port.get("HostPort") == str(port.port) if not host_matching: return True return False