From 96846220c329cad5d9558b54005a392f4c13f3ef Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 16 Oct 2020 21:08:35 +0200 Subject: [PATCH] outposts: trigger reconcile on save --- passbook/outposts/tasks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/passbook/outposts/tasks.py b/passbook/outposts/tasks.py index b4a3cd5df..181f3edf9 100644 --- a/passbook/outposts/tasks.py +++ b/passbook/outposts/tasks.py @@ -34,7 +34,7 @@ def outpost_controller_all(): @CELERY_APP.task(bind=True, base=MonitoredTask) def outpost_controller(self: MonitoredTask, outpost_pk: str): - """Launch controller and reconcile deployment/service/etc""" + """Launch controller deployment of Outpost""" logs = [] outpost: Outpost = Outpost.objects.get(pk=outpost_pk) try: @@ -67,6 +67,8 @@ def outpost_post_save(model_class: str, model_pk: Any): if isinstance(instance, Outpost): LOGGER.debug("Ensuring token for outpost", instance=instance) _ = instance.token + LOGGER.debug("Trigger reconcile for outpost") + outpost_controller.delay(instance.pk) return if isinstance(instance, (OutpostModel, Outpost)):