From 315b34994073edfcd963e85f222448eec76f3be4 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 17 Sep 2025 23:33:13 +0200 Subject: [PATCH] Add templates_dir input param to cluster registration workflow Change-Id: I415d933249f8a30d547bbc6fbefbaa577e4183bb Signed-off-by: garciadeblas --- osm_lcm/odu_libs/cluster_mgmt.py | 11 +++++++++++ .../odu_libs/templates/launcher-bootstrap-cluster.j2 | 2 ++ 2 files changed, 13 insertions(+) diff --git a/osm_lcm/odu_libs/cluster_mgmt.py b/osm_lcm/odu_libs/cluster_mgmt.py index 60c03785..0905f21d 100644 --- a/osm_lcm/odu_libs/cluster_mgmt.py +++ b/osm_lcm/odu_libs/cluster_mgmt.py @@ -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, ) diff --git a/osm_lcm/odu_libs/templates/launcher-bootstrap-cluster.j2 b/osm_lcm/odu_libs/templates/launcher-bootstrap-cluster.j2 index a1ae75e4..0b8e7ead 100644 --- a/osm_lcm/odu_libs/templates/launcher-bootstrap-cluster.j2 +++ b/osm_lcm/odu_libs/templates/launcher-bootstrap-cluster.j2 @@ -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 -- 2.25.1