outposts: catch invalid ServiceConnection error in outpost controller

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-01 12:25:11 +02:00
parent 18bb4fd0bf
commit 35c1476bbe
1 changed files with 2 additions and 1 deletions

View File

@ -28,6 +28,7 @@ from authentik.outposts.models import (
OutpostServiceConnection, OutpostServiceConnection,
OutpostState, OutpostState,
OutpostType, OutpostType,
ServiceConnectionInvalid,
) )
from authentik.providers.ldap.controllers.docker import LDAPDockerController from authentik.providers.ldap.controllers.docker import LDAPDockerController
from authentik.providers.ldap.controllers.kubernetes import LDAPKubernetesController from authentik.providers.ldap.controllers.kubernetes import LDAPKubernetesController
@ -114,7 +115,7 @@ def outpost_controller(
for log in logs: for log in logs:
LOGGER.debug(log) LOGGER.debug(log)
LOGGER.debug("-----------------Outpost Controller logs end-------------------") LOGGER.debug("-----------------Outpost Controller logs end-------------------")
except ControllerException as exc: except (ControllerException, ServiceConnectionInvalid) as exc:
self.set_status(TaskResult(TaskResultStatus.ERROR).with_error(exc)) self.set_status(TaskResult(TaskResultStatus.ERROR).with_error(exc))
else: else:
self.set_status(TaskResult(TaskResultStatus.SUCCESSFUL, logs)) self.set_status(TaskResult(TaskResultStatus.SUCCESSFUL, logs))