outposts: trigger reconcile on save
This commit is contained in:
parent
a4f5678144
commit
96846220c3
|
@ -34,7 +34,7 @@ def outpost_controller_all():
|
||||||
|
|
||||||
@CELERY_APP.task(bind=True, base=MonitoredTask)
|
@CELERY_APP.task(bind=True, base=MonitoredTask)
|
||||||
def outpost_controller(self: MonitoredTask, outpost_pk: str):
|
def outpost_controller(self: MonitoredTask, outpost_pk: str):
|
||||||
"""Launch controller and reconcile deployment/service/etc"""
|
"""Launch controller deployment of Outpost"""
|
||||||
logs = []
|
logs = []
|
||||||
outpost: Outpost = Outpost.objects.get(pk=outpost_pk)
|
outpost: Outpost = Outpost.objects.get(pk=outpost_pk)
|
||||||
try:
|
try:
|
||||||
|
@ -67,6 +67,8 @@ def outpost_post_save(model_class: str, model_pk: Any):
|
||||||
if isinstance(instance, Outpost):
|
if isinstance(instance, Outpost):
|
||||||
LOGGER.debug("Ensuring token for outpost", instance=instance)
|
LOGGER.debug("Ensuring token for outpost", instance=instance)
|
||||||
_ = instance.token
|
_ = instance.token
|
||||||
|
LOGGER.debug("Trigger reconcile for outpost")
|
||||||
|
outpost_controller.delay(instance.pk)
|
||||||
return
|
return
|
||||||
|
|
||||||
if isinstance(instance, (OutpostModel, Outpost)):
|
if isinstance(instance, (OutpostModel, Outpost)):
|
||||||
|
|
Reference in a new issue