From: garciadeblas Date: Thu, 3 Apr 2025 22:19:13 +0000 (+0200) Subject: Update profile state and agekeys during cluster registration X-Git-Tag: v18.0.0~18 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F57%2F15157%2F1;p=osm%2FLCM.git Update profile state and agekeys during cluster registration Change-Id: I612f4fa22d2008f740f5d60c3692d8094d7a2842 Signed-off-by: garciadeblas --- diff --git a/osm_lcm/k8s.py b/osm_lcm/k8s.py index cd22a995..21df2b18 100644 --- a/osm_lcm/k8s.py +++ b/osm_lcm/k8s.py @@ -353,6 +353,8 @@ class ClusterLcm(GitOpsLcm): async def create(self, params, order_id): self.logger.info("cluster Create Enter") + workflow_status = None + resource_status = None # To get the cluster and op ids cluster_id = params["cluster_id"] @@ -980,6 +982,8 @@ class ClusterLcm(GitOpsLcm): async def register(self, params, order_id): self.logger.info("cluster register enter") + workflow_status = None + resource_status = None # To get the cluster and op ids cluster_id = params["cluster_id"] @@ -995,8 +999,9 @@ class ClusterLcm(GitOpsLcm): op_params = self.get_operation_params(db_cluster, op_id) # To copy the cluster content and decrypting fields to use in workflows + db_cluster_copy = self.decrypted_copy(db_cluster) workflow_content = { - "cluster": self.decrypted_copy(db_cluster), + "cluster": db_cluster_copy, } workflow_res, workflow_name = await self.odu.launch_workflow( @@ -1069,6 +1074,10 @@ class ClusterLcm(GitOpsLcm): db_cluster["current_operation"] = None self.db.set_one("clusters", {"_id": db_cluster["_id"]}, db_cluster) + # Update default profile agekeys and state + self.update_default_profile_agekeys(db_cluster_copy) + self.update_profile_state(db_cluster, workflow_status, resource_status) + db_register = self.db.get_one("k8sclusters", {"name": db_cluster["name"]}) db_register["credentials"] = db_cluster["credentials"] self.db.set_one("k8sclusters", {"_id": db_register["_id"]}, db_register)