Add templates_dir input param to cluster registration workflow 09/15409/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 17 Sep 2025 21:33:13 +0000 (23:33 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 18 Sep 2025 07:47:41 +0000 (09:47 +0200)
Change-Id: I415d933249f8a30d547bbc6fbefbaa577e4183bb
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osm_lcm/odu_libs/cluster_mgmt.py
osm_lcm/odu_libs/templates/launcher-bootstrap-cluster.j2

index 60c0378..0905f21 100644 (file)
@@ -399,6 +399,16 @@ async def register_cluster(self, op_id, op_params, content):
     # Additional params for the workflow
     cluster_kustomization_name = cluster_name
     osm_project_name = "osm_admin"  # TODO: get project name from content
+    if db_cluster.get("openshift", True):
+        templates_dir = "/sw-catalogs/sw-catalogs-osm/cloud-resources/flux-remote-bootstrap/cluster-base-openshift/templates"
+        self.logger.info(
+            "Rendering OpenShift bootstrap templates from %s", templates_dir
+        )
+    else:
+        templates_dir = "/sw-catalogs/sw-catalogs-osm/cloud-resources/flux-remote-bootstrap/cluster-base/templates"
+        self.logger.info(
+            "Rendering Standard bootstrap templates from %s", templates_dir
+        )
 
     manifest = self.render_jinja_template(
         workflow_template,
@@ -412,6 +422,7 @@ async def register_cluster(self, op_id, op_params, content):
         public_key_new_cluster=public_key_new_cluster,
         secret_name_private_key_new_cluster=secret_name,
         osm_project_name=osm_project_name,
+        templates_dir=templates_dir,
         workflow_debug=self._workflow_debug,
         workflow_dry_run=self._workflow_dry_run,
     )
index a1ae75e..0b8e7ea 100644 (file)
@@ -54,6 +54,8 @@ spec:
       value: "agekey"
     - name: mgmt_project_name
       value: "{{ osm_project_name }}"
+    - name: templates_dir
+      value: "{{ templates_dir }}"
 
     # Debug/dry run?
     - name: debug