outposts: don't run outpost_controller when no service connection is set

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-19 19:10:02 +02:00
parent 9c8433ec4d
commit b75feab709
1 changed files with 2 additions and 0 deletions

View File

@ -67,6 +67,8 @@ def outpost_controller(self: MonitoredTask, outpost_pk: str):
outpost: Outpost = Outpost.objects.get(pk=outpost_pk) outpost: Outpost = Outpost.objects.get(pk=outpost_pk)
self.set_uid(slugify(outpost.name)) self.set_uid(slugify(outpost.name))
try: try:
if not outpost.service_connection:
return
if outpost.type == OutpostType.PROXY: if outpost.type == OutpostType.PROXY:
service_connection = outpost.service_connection service_connection = outpost.service_connection
if isinstance(service_connection, DockerServiceConnection): if isinstance(service_connection, DockerServiceConnection):