From 9cd5345320bde874db53c9e5dabd9c6c871ccfdf Mon Sep 17 00:00:00 2001 From: Gabriel Cuba Date: Thu, 21 Mar 2024 17:14:05 -0500 Subject: [PATCH] Fixes VCA deletion in NS termination Change-Id: I3abfed8a389620cdc1ef8207a53c53c8c7ba6854 Signed-off-by: Gabriel Cuba --- osm_lcm/ns.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 57298bd..8e42ddc 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -4522,16 +4522,8 @@ class NsLcm(LcmBase): if nsr_deployed.get("VCA"): stage[1] = "Deleting all execution environments." self.logger.debug(logging_text + stage[1]) - if nsr_deployed.get("VCA").get("type") != "helm-v3": - vca_id = self.get_vca_id({}, db_nsr) - task_delete_ee = asyncio.ensure_future( - asyncio.wait_for( - self._delete_all_N2VC(db_nsr=db_nsr, vca_id=vca_id), - timeout=self.timeout.charm_delete, - ) - ) - tasks_dict_info[task_delete_ee] = "Terminating all VCA" - else: + helm_vca_list = get_deployed_vca(db_nsr, {"type": "helm-v3"}) + if helm_vca_list: # Delete Namespace and Certificates await self.vca_map["helm-v3"].delete_tls_certificate( namespace=db_nslcmop["nsInstanceId"], @@ -4540,6 +4532,15 @@ class NsLcm(LcmBase): await self.vca_map["helm-v3"].delete_namespace( namespace=db_nslcmop["nsInstanceId"], ) + else: + vca_id = self.get_vca_id({}, db_nsr) + task_delete_ee = asyncio.ensure_future( + asyncio.wait_for( + self._delete_all_N2VC(db_nsr=db_nsr, vca_id=vca_id), + timeout=self.timeout.charm_delete, + ) + ) + tasks_dict_info[task_delete_ee] = "Terminating all VCA" # Delete from k8scluster stage[1] = "Deleting KDUs." -- 2.25.1