Update cluster create and update Jinja workflows to use rg_name and preemptible_nodes
Change-Id: I6a22e7163b95c20921c57217a1e6156bfc70951d
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 73405ec..bed2781 100644
--- a/osm_lcm/odu_libs/cluster_mgmt.py
+++ b/osm_lcm/odu_libs/cluster_mgmt.py
@@ -120,7 +120,8 @@
k8s_version=db_cluster["k8s_version"],
cluster_location=db_cluster["region_name"],
osm_project_name=osm_project_name,
- rg_name=db_cluster["resource_group"],
+ rg_name=db_cluster.get("resource_group", "''"),
+ preemptible_nodes=db_cluster.get("preemptible_nodes", "false"),
skip_bootstrap=skip_bootstrap,
workflow_debug=self._workflow_debug,
workflow_dry_run=self._workflow_dry_run,
@@ -208,6 +209,8 @@
k8s_version=k8s_version,
cluster_location=db_cluster["region_name"],
osm_project_name=osm_project_name,
+ rg_name=db_cluster.get("resource_group", "''"),
+ preemptible_nodes=db_cluster.get("preemptible_nodes", "false"),
workflow_debug=self._workflow_debug,
workflow_dry_run=self._workflow_dry_run,
)
diff --git a/osm_lcm/odu_libs/templates/launcher-create-crossplane-cluster-and-bootstrap.j2 b/osm_lcm/odu_libs/templates/launcher-create-crossplane-cluster-and-bootstrap.j2
index c965eff..11f0fed 100644
--- a/osm_lcm/odu_libs/templates/launcher-create-crossplane-cluster-and-bootstrap.j2
+++ b/osm_lcm/odu_libs/templates/launcher-create-crossplane-cluster-and-bootstrap.j2
@@ -75,7 +75,7 @@
# Specific parameters - GKE only
- name: preemptible_nodes
- value: "false"
+ value: "{{ preemptible_nodes }}"
# Advanced parameters - Recommended to keep defaults
- name: skip_bootstrap
diff --git a/osm_lcm/odu_libs/templates/launcher-update-crossplane-cluster.j2 b/osm_lcm/odu_libs/templates/launcher-update-crossplane-cluster.j2
index 1df8c68..3d1cbf2 100644
--- a/osm_lcm/odu_libs/templates/launcher-update-crossplane-cluster.j2
+++ b/osm_lcm/odu_libs/templates/launcher-update-crossplane-cluster.j2
@@ -71,11 +71,11 @@
# Specific parameters - AKS only
- name: rg_name
- value: CloudNative-OSM
+ value: {{ rg_name }}
# Specific parameters - GKE only
- name: preemptible_nodes
- value: "false"
+ value: "{{ preemptible_nodes }}"
# Advanced parameters - Recommended to keep defaults
- name: mgmt_cluster_name