+ if cluster_type == "helm-chart-v3":
+ try:
+ # backward compatibility for existing clusters that have not been initialized for helm v3
+ k8s_credentials = yaml.safe_dump(db_k8scluster.get("credentials"))
+ k8s_id, uninstall_sw = await self.k8sclusterhelm3.init_env(k8s_credentials,
+ reuse_cluster_uuid=cluster_id)
+ db_k8scluster_update = {}
+ db_k8scluster_update["_admin.helm-chart-v3.error_msg"] = None
+ db_k8scluster_update["_admin.helm-chart-v3.id"] = k8s_id
+ db_k8scluster_update["_admin.helm-chart-v3.created"] = uninstall_sw
+ db_k8scluster_update["_admin.helm-chart-v3.operationalState"] = "ENABLED"
+ self.update_db_2("k8sclusters", cluster_id, db_k8scluster_update)
+ except Exception as e:
+ self.logger.error(logging_text + "error initializing helm-v3 cluster: {}".format(str(e)))
+ raise LcmException("K8s cluster '{}' has not been initialized for '{}'".format(cluster_id,
+ cluster_type))
+ else:
+ raise LcmException("K8s cluster '{}' has not been initialized for '{}'".
+ format(cluster_id, cluster_type))