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):
|
def _clear_kubernetes_caches(self):
|
||||||
"""Clears cached properties that depend on Kubernetes state."""
|
"""Clears cached properties that depend on Kubernetes state."""
|
||||||
attrs = self.__dict__.keys()
|
attrs = self.__dict__.keys()
|
||||||
if "kubernetes_object" in attrs:
|
for key in (
|
||||||
del self.kubernetes_object
|
"kubernetes_object",
|
||||||
if "spec" in attrs:
|
"spec",
|
||||||
del self.spec
|
"status_conditions",
|
||||||
if "status_conditions" in attrs:
|
"connection_credentials",
|
||||||
del self.status_conditions
|
):
|
||||||
if "connection_credentials" in attrs:
|
if key in attrs:
|
||||||
del self.connection_credentials
|
delattr(self, key)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create_instance(cls, name, organization, context, created_by, spec_data):
|
def create_instance(cls, name, organization, context, created_by, spec_data):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue