Fix Bug 2178: Optional atomic flag in helm upgrades 25/12625/1 v10.1.3 v10.1.4
authorlimon <alimonj@indra.es>
Fri, 28 Oct 2022 08:39:16 +0000 (10:39 +0200)
committerlimon <alimonj@indra.es>
Fri, 28 Oct 2022 10:20:23 +0000 (12:20 +0200)
Change-Id: I0552ebac311eff509ab601f0e8cdcd49b172c367
Signed-off-by: limon <alimonj@indra.es>
osm_lcm/ns.py

index 5cd55fb..2694f76 100644 (file)
@@ -4902,12 +4902,17 @@ class NsLcm(LcmBase):
                         parts = kdu_model.split(sep=":")
                         if len(parts) == 2:
                             kdu_model = parts[0]
+                    if desc_params.get("kdu_atomic_upgrade"):
+                        atomic_upgrade = desc_params.get("kdu_atomic_upgrade").lower() in ("yes", "true", "1")
+                        del desc_params["kdu_atomic_upgrade"]
+                    else:
+                        atomic_upgrade = True
 
                     detailed_status = await asyncio.wait_for(
                         self.k8scluster_map[kdu["k8scluster-type"]].upgrade(
                             cluster_uuid=kdu.get("k8scluster-uuid"),
                             kdu_instance=kdu.get("kdu-instance"),
-                            atomic=True,
+                            atomic=atomic_upgrade,
                             kdu_model=kdu_model,
                             params=desc_params,
                             db_dict=db_dict,