diff --git a/osm_lcm/k8s.py b/osm_lcm/k8s.py index cd22a9957d2235492bb77306426f6d2cebf6608b..21df2b188dc137b6aa7ba4eedf734b719501b5b7 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)