From 5ac6a6910edaaa7ffb950ba65a54829b57f2a433 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 8 May 2021 21:59:13 +0200 Subject: [PATCH] outposts: check if traefik CRD exists before attempting to delete Signed-off-by: Jens Langhammer --- authentik/outposts/controllers/k8s/base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/authentik/outposts/controllers/k8s/base.py b/authentik/outposts/controllers/k8s/base.py index ab7caac34..55c9fe7ad 100644 --- a/authentik/outposts/controllers/k8s/base.py +++ b/authentik/outposts/controllers/k8s/base.py @@ -90,6 +90,12 @@ class KubernetesObjectReconciler(Generic[T]): def down(self): """Delete object if found""" + # Call self.get_reference_object to check if we even need to do anything + try: + self.get_reference_object() + except Disabled: + self.logger.debug("Object not required") + return try: current = self.retrieve() self.delete(current)