del desc_params["kdu_atomic_upgrade"]
else:
atomic_upgrade = True
+ # Type of upgrade: reset, reuse, reset_then_reuse
+ reset_values = False
+ reuse_values = False
+ reset_then_reuse_values = False
+ # If no option is specified, default behaviour is reuse_values
+ # Otherwise, options will be parsed and used
+ if (
+ ("kdu_reset_values" not in desc_params)
+ and ("kdu_reuse_values" not in desc_params)
+ and ("kdu_reset_then_reuse_values" not in desc_params)
+ ):
+ reuse_values = True
+ else:
+ if desc_params.get("kdu_reset_values"):
+ reset_values = desc_params.pop(
+ "kdu_reset_values"
+ ).lower() in ("yes", "true", "1")
+ if desc_params.get("kdu_reuse_values"):
+ reuse_values = desc_params.pop(
+ "kdu_reuse_values"
+ ).lower() in ("yes", "true", "1")
+ if desc_params.get("kdu_reset_then_reuse_values"):
+ reset_then_reuse_values = desc_params.get(
+ "kdu_reset_then_reuse_values"
+ ).lower() in ("yes", "true", "1")
+ # Two true options are not possible
+ if (
+ sum([reset_values, reuse_values, reset_then_reuse_values])
+ >= 2
+ ):
+ raise LcmException(
+ "Cannot upgrade the KDU simultaneously with two true options to handle values"
+ )
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=atomic_upgrade,
+ reset_values=reset_values,
+ reuse_values=reuse_values,
+ reset_then_reuse_values=reset_then_reuse_values,
kdu_model=kdu_model,
params=desc_params,
db_dict=db_dict,