outposts: check if traefik CRD exists before attempting to delete
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
d751a7fc4c
commit
5ac6a6910e
|
@ -90,6 +90,12 @@ class KubernetesObjectReconciler(Generic[T]):
|
||||||
|
|
||||||
def down(self):
|
def down(self):
|
||||||
"""Delete object if found"""
|
"""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:
|
try:
|
||||||
current = self.retrieve()
|
current = self.retrieve()
|
||||||
self.delete(current)
|
self.delete(current)
|
||||||
|
|
Reference in New Issue