Improve cached data deletion
This commit is contained in:
parent
8a67e16a0b
commit
ba30fb0402
1 changed files with 8 additions and 8 deletions
|
@ -518,14 +518,14 @@ class ServiceInstance(ServalaModelMixin, models.Model):
|
|||
def _clear_kubernetes_caches(self):
|
||||
"""Clears cached properties that depend on Kubernetes state."""
|
||||
attrs = self.__dict__.keys()
|
||||
if "kubernetes_object" in attrs:
|
||||
del self.kubernetes_object
|
||||
if "spec" in attrs:
|
||||
del self.spec
|
||||
if "status_conditions" in attrs:
|
||||
del self.status_conditions
|
||||
if "connection_credentials" in attrs:
|
||||
del self.connection_credentials
|
||||
for key in (
|
||||
"kubernetes_object",
|
||||
"spec",
|
||||
"status_conditions",
|
||||
"connection_credentials",
|
||||
):
|
||||
if key in attrs:
|
||||
delattr(self, key)
|
||||
|
||||
@classmethod
|
||||
def create_instance(cls, name, organization, context, created_by, spec_data):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue