diff --git a/osm_lcm/k8s.py b/osm_lcm/k8s.py index 70dee64dad6c82c5a3aab9eeebb835103b95836b..ab6001b74f9c65a74c59abb060660622eb489873 100644 --- a/osm_lcm/k8s.py +++ b/osm_lcm/k8s.py @@ -563,6 +563,8 @@ class ClusterLcm(GitOpsLcm): # To copy the cluster content and decrypting the key to use in workflows db_cluster_copy = self.decrypting_key(db_cluster) + # TODO: workaround until NBI rejects cluster deletion requests for registered clusters + # This if clause will be removed if db_cluster["created"] == "false": return await self.deregister(params, order_id) @@ -991,6 +993,9 @@ class ClusterLcm(GitOpsLcm): db_cluster = self.update_operation_history( db_cluster, op_id, workflow_status, resource_status ) + # TODO: workaround until NBI rejects cluster deletion requests for registered clusters + # Setting created flag to true avoids infinite loops when deregistering a cluster + db_cluster["created"] = "true" self.db.set_one("clusters", {"_id": db_cluster["_id"]}, db_cluster) return await self.delete(params, order_id)