diff --git a/authentik/outposts/controllers/docker.py b/authentik/outposts/controllers/docker.py index fc1e78557..aa7a6781e 100644 --- a/authentik/outposts/controllers/docker.py +++ b/authentik/outposts/controllers/docker.py @@ -56,9 +56,15 @@ class DockerController(BaseController): def _comp_ports(self, container: Container) -> bool: """Check that the container has the correct ports exposed. Return true if container needs to be rebuilt.""" + # with TEST enabled, we use host-network + if settings.TEST: + return False + # 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'}]} for port in self.deployment_ports: - key = f"{port.inner_port or port.port}/{port.protocol}" + key = f"{port.inner_port or port.port}/{port.protocol.lower()}" if key not in container.ports: return True host_matching = False