Update list of checks for AWS and GCP cluster creation
Change-Id: I7ae53a6098b10cea1deeb93979dfee165fbb2d84
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/osm_lcm/odu_libs/cluster_mgmt.py b/osm_lcm/odu_libs/cluster_mgmt.py
index 1c21675..a3c821b 100644
--- a/osm_lcm/odu_libs/cluster_mgmt.py
+++ b/osm_lcm/odu_libs/cluster_mgmt.py
@@ -442,44 +442,60 @@
cluster_kustomization_name = cluster_name
db_vim_account = content["vim_account"]
cloud_type = db_vim_account["vim_type"]
+ nodepool_name = ""
+ if cloud_type == "aws":
+ nodepool_name = f"{cluster_name}-nodegroup"
+ cluster_name = f"{cluster_name}-cluster"
+ elif cloud_type == "gcp":
+ nodepool_name = f"nodepool-{cluster_name}"
bootstrap = op_params.get("bootstrap", True)
- if cloud_type not in ("azure", "gcp", "aws"):
+ if cloud_type in ("azure", "gcp", "aws"):
+ checkings_list = [
+ {
+ "item": "kustomization",
+ "name": cluster_kustomization_name,
+ "namespace": "managed-resources",
+ "flag": "Ready",
+ "timeout": self._odu_checkloop_kustomization_timeout,
+ "enable": True,
+ },
+ {
+ "item": f"cluster_{cloud_type}",
+ "name": cluster_name,
+ "namespace": "",
+ "flag": "Synced",
+ "timeout": self._odu_checkloop_resource_timeout,
+ "enable": True,
+ },
+ {
+ "item": f"cluster_{cloud_type}",
+ "name": cluster_name,
+ "namespace": "",
+ "flag": "Ready",
+ "timeout": self._odu_checkloop_resource_timeout,
+ "enable": True,
+ },
+ {
+ "item": "kustomization",
+ "name": f"{cluster_kustomization_name}-bstrp-fluxctrl",
+ "namespace": "managed-resources",
+ "flag": "Ready",
+ "timeout": self._odu_checkloop_kustomization_timeout,
+ "enable": bootstrap,
+ },
+ ]
+ else:
return False, "Not suitable VIM account to check cluster status"
-
- checkings_list = [
- {
- "item": "kustomization",
- "name": cluster_kustomization_name,
- "namespace": "managed-resources",
- "flag": "Ready",
- "timeout": self._odu_checkloop_kustomization_timeout,
- "enable": True,
- },
- {
- "item": f"cluster_{cloud_type}",
- "name": cluster_name,
- "namespace": "",
- "flag": "Synced",
- "timeout": self._odu_checkloop_resource_timeout,
- "enable": True,
- },
- {
- "item": f"cluster_{cloud_type}",
- "name": cluster_name,
+ if nodepool_name:
+ nodepool_check = {
+ "item": f"nodepool_{cloud_type}",
+ "name": nodepool_name,
"namespace": "",
"flag": "Ready",
"timeout": self._odu_checkloop_resource_timeout,
"enable": True,
- },
- {
- "item": "kustomization",
- "name": f"{cluster_kustomization_name}-bstrp-fluxctrl",
- "namespace": "managed-resources",
- "flag": "Ready",
- "timeout": self._odu_checkloop_kustomization_timeout,
- "enable": bootstrap,
- },
- ]
+ }
+ checkings_list.insert(3, nodepool_check)
return await self.common_check_list(checkings_list)