From f072c600cc360fd9d3443c30a01051c871c025e7 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 9 May 2021 20:13:58 +0200 Subject: [PATCH] lifecycle: use URl for redis on startup to prevent errors with no paswords Signed-off-by: Jens Langhammer --- authentik/outposts/controllers/kubernetes.py | 1 + lifecycle/wait_for_db.py | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/authentik/outposts/controllers/kubernetes.py b/authentik/outposts/controllers/kubernetes.py index 736d044c8..09888ee81 100644 --- a/authentik/outposts/controllers/kubernetes.py +++ b/authentik/outposts/controllers/kubernetes.py @@ -61,6 +61,7 @@ class KubernetesController(BaseController): try: for reconcile_key in self.reconcile_order: reconciler = self.reconcilers[reconcile_key](self) + self.logger.debug("Tearing down object", name=reconcile_key) reconciler.down() except ApiException as exc: diff --git a/lifecycle/wait_for_db.py b/lifecycle/wait_for_db.py index 64a6fd926..462041cfb 100755 --- a/lifecycle/wait_for_db.py +++ b/lifecycle/wait_for_db.py @@ -41,11 +41,9 @@ while True: while True: try: - redis = Redis( - host=CONFIG.y("redis.host"), - port=6379, - db=CONFIG.y("redis.message_queue_db"), - password=CONFIG.y("redis.password"), + redis = Redis.from_url( + f"redis://:{CONFIG.y('redis.password')}@{CONFIG.y('redis.host')}:6379" + f"/{CONFIG.y('redis.ws_db')}" ) redis.ping() break