Adding new cluster update function
Change-Id: I5733e7daf6189339836485f3d9d841f2647cad88
Signed-off-by: yshah <shahithya.y@tataelxsi.co.in>
diff --git a/osm_lcm/k8s.py b/osm_lcm/k8s.py
index 55d98f4..51e04ae 100644
--- a/osm_lcm/k8s.py
+++ b/osm_lcm/k8s.py
@@ -853,18 +853,21 @@
else:
db_cluster["resourceState"] = "ERROR"
+ db_cluster = self.update_operation_history(
+ db_cluster, workflow_status, resource_status
+ )
+
db_cluster["operatingState"] = "IDLE"
- db_cluster = self.update_operation_history(
- db_cluster, workflow_status, resource_status
- )
# self.logger.info("db_cluster: {}".format(db_cluster))
# TODO: verify enxtcondition
# For the moment, if the workflow completed successfully, then we update the db accordingly.
if workflow_status:
if "k8s_version" in op_params:
db_cluster["k8s_version"] = op_params["k8s_version"]
- elif "node_count" in op_params:
+ if "node_count" in op_params:
db_cluster["node_count"] = op_params["node_count"]
+ if "node_size" in op_params:
+ db_cluster["node_count"] = op_params["node_size"]
# self.db.set_one(self.db_collection, {"_id": _id}, db_content)
db_cluster["current_operation"] = None
self.db.set_one("clusters", {"_id": db_cluster["_id"]}, db_cluster)
diff --git a/osm_lcm/lcm.py b/osm_lcm/lcm.py
index 89d877b..fe93778 100644
--- a/osm_lcm/lcm.py
+++ b/osm_lcm/lcm.py
@@ -863,7 +863,7 @@
"cluster", cluster_id, cluster_id, "cluster_get_credentials", task
)
return
- elif command == "upgrade" or command == "scale":
+ elif command == "upgrade" or command == "scale" or command == "update":
# db_vim = self.db.get_one("vim_accounts", {"_id": db_cluster["vim_account"]})
db_vim = self.db.get_one(
"vim_accounts", {"name": db_cluster["vim_account"]}