From e5a5a5c603ae11a4fe83d8689956bfbda53fbe5a Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 7 May 2021 09:52:43 +0200 Subject: [PATCH] outposts: fix k8s controller not handing Disabled() in static deployment Signed-off-by: Jens Langhammer --- authentik/outposts/controllers/kubernetes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/authentik/outposts/controllers/kubernetes.py b/authentik/outposts/controllers/kubernetes.py index 1b6d3e58d..736d044c8 100644 --- a/authentik/outposts/controllers/kubernetes.py +++ b/authentik/outposts/controllers/kubernetes.py @@ -8,7 +8,7 @@ from structlog.testing import capture_logs from yaml import dump_all from authentik.outposts.controllers.base import BaseController, ControllerException -from authentik.outposts.controllers.k8s.base import KubernetesObjectReconciler +from authentik.outposts.controllers.k8s.base import Disabled, KubernetesObjectReconciler from authentik.outposts.controllers.k8s.deployment import DeploymentReconciler from authentik.outposts.controllers.k8s.secret import SecretReconciler from authentik.outposts.controllers.k8s.service import ServiceReconciler @@ -70,7 +70,10 @@ class KubernetesController(BaseController): documents = [] for reconcile_key in self.reconcile_order: reconciler = self.reconcilers[reconcile_key](self) - documents.append(reconciler.get_reference_object().to_dict()) + try: + documents.append(reconciler.get_reference_object().to_dict()) + except Disabled: + continue with StringIO() as _str: dump_all(