Skip to content
Snippets Groups Projects
Commit 6b2112c1 authored by garciadeblas's avatar garciadeblas
Browse files

Add workaround to avoid infinite loop in cluster deregistration


Change-Id: Ia921b23433d1ba0450e96aaac9e4b4d1370977c1
Signed-off-by: default avatargarciadeblas <gerardo.garciadeblas@telefonica.com>
parent 2f39b8a4
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment