From bafeff73066ccd1cb2dcbb92d85ca04dc46fbc89 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 11 Dec 2021 15:35:20 +0100 Subject: [PATCH] outposts: improve logging for outpost controllers Signed-off-by: Jens Langhammer --- authentik/outposts/controllers/docker.py | 2 ++ authentik/outposts/tasks.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/authentik/outposts/controllers/docker.py b/authentik/outposts/controllers/docker.py index c032718cd..9867f5b3b 100644 --- a/authentik/outposts/controllers/docker.py +++ b/authentik/outposts/controllers/docker.py @@ -230,7 +230,9 @@ class DockerController(BaseController): try: container, _ = self._get_container() if container.status == "running": + self.logger.info("Stopping container.") container.kill() + self.logger.info("Removing container.") container.remove(force=True) except DockerException as exc: raise ControllerException(str(exc)) from exc diff --git a/authentik/outposts/tasks.py b/authentik/outposts/tasks.py index 737b1ef15..2b9c9e07e 100644 --- a/authentik/outposts/tasks.py +++ b/authentik/outposts/tasks.py @@ -105,9 +105,12 @@ def outpost_controller( logs = [] if from_cache: outpost: Outpost = cache.get(CACHE_KEY_OUTPOST_DOWN % outpost_pk) + LOGGER.debug("Getting outpost from cache to delete") else: outpost: Outpost = Outpost.objects.filter(pk=outpost_pk).first() + LOGGER.debug("Getting outpost from DB") if not outpost: + LOGGER.warning("No outpost") return self.set_uid(slugify(outpost.name)) try: