lifecycle: use URl for redis on startup to prevent errors with no paswords

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-09 20:13:58 +02:00
parent 65b8a5bb8d
commit f072c600cc
2 changed files with 4 additions and 5 deletions

View File

@ -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:

View File

@ -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