- uninstall_sw = db_k8scluster.get("uninstall-sw")
- if uninstall_sw is False or uninstall_sw is None:
- uninstall_sw = False
- cluster_removed = await self.k8scluster.reset(cluster_uuid=db_k8scluster.get("cluster-uuid"),
- uninstall_sw=uninstall_sw)
+ k8s_hc_id = deep_get(db_k8scluster, ("_admin", "helm-chart", "id"))
+ k8s_jb_id = deep_get(db_k8scluster, ("_admin", "juju-bundle", "id"))
+
+ uninstall_sw = deep_get(db_k8scluster, ("_admin", "helm-chart", "created"))
+ cluster_removed = True
+ if k8s_hc_id:
+ uninstall_sw = uninstall_sw or False
+ cluster_removed = await self.helm_k8scluster.reset(cluster_uuid=k8s_hc_id, uninstall_sw=uninstall_sw)
+
+ if k8s_jb_id:
+ uninstall_sw = uninstall_sw or False
+ cluster_removed = await self.juju_k8scluster.reset(cluster_uuid=k8s_jb_id, uninstall_sw=uninstall_sw)