Parse status conditions

This commit is contained in:
Tobias Kunze 2025-04-11 12:47:31 +02:00
parent 912842bd82
commit 6d34e3abdc

View file

@ -597,3 +597,11 @@ class ServiceInstance(ServalaModelMixin, models.Model):
spec.pop("resourceRef", None) spec.pop("resourceRef", None)
spec.pop("writeConnectionSecretToRef", None) spec.pop("writeConnectionSecretToRef", None)
return spec return spec
@cached_property
def status_conditions(self):
if not self.kubernetes_object:
return []
if not (status := self.kubernetes_object.get("status")):
return []
return status.get("conditions") or []