Feature 11057: Cluster management in Openshift-based infrastructures 14/15314/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 5 Aug 2025 07:15:33 +0000 (09:15 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 5 Aug 2025 16:36:39 +0000 (18:36 +0200)
Change-Id: I2ff2f415b0d45e096b9f2f00dcb9b4015a8c8b52
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osm_nbi/k8s_topics.py

index dc6016c..89f8031 100644 (file)
@@ -328,8 +328,7 @@ class ClusterTopic(ACMTopic):
             "vim_accounts", {"name": content["vim_account"]}
         )
 
-        # Add optional fields if they exist in the request
-
+        # Add optional fields if they don't exist in the request
         if "region_name" not in indata:
             region_name = vim_account_details.get("config", {}).get("region_name")
             if region_name:
@@ -342,10 +341,12 @@ class ClusterTopic(ACMTopic):
 
         version = "k8s_version" in content
         if not version:
-            content["k8s_version"] = "1.28"
+            content["k8s_version"] = "1.32"
+        # Additional cluster information, specific for each cluster type
+        content["config"] = indata.get("config", {})
         content["node_count"] = indata.get("node_count", 0)
         content["ksu_count"] = 0
-        self.logger.info(f"cotent is : {content}")
+        self.logger.info(f"content is : {content}")
         return content
 
     def check_vim(self, session, name):
@@ -896,6 +897,7 @@ class ClusterOpsTopic(ACMTopic):
             "credentials": cls_add_request["credentials"],
             "vim_account": cls_add_request["vim_account"],
             "bootstrap": cls_add_request["bootstrap"],
+            "openshift": cls_add_request.get("openshift", False),
             "infra_controller_profiles": [
                 self._create_default_profiles(
                     rollback, session, indata, kwargs, headers, self.infra_contr_topic