summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/internal/app/instance.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/k8splugin/internal/app/instance.go')
-rw-r--r--src/k8splugin/internal/app/instance.go22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/k8splugin/internal/app/instance.go b/src/k8splugin/internal/app/instance.go
index 0f1f3d7e..b7f382ad 100644
--- a/src/k8splugin/internal/app/instance.go
+++ b/src/k8splugin/internal/app/instance.go
@@ -709,7 +709,8 @@ func (v *InstanceClient) Delete(id string) error {
return nil
} else if inst.Status != "DONE" {
//Recover is ongoing, do nothing here
- return nil
+ //return nil
+ //TODO: implement recovery
}
k8sClient := KubernetesClient{}
@@ -718,12 +719,6 @@ func (v *InstanceClient) Delete(id string) error {
return pkgerrors.Wrap(err, "Getting CloudRegion Information")
}
- configClient := NewConfigClient()
- configs, err := configClient.List(id)
- if err != nil {
- return pkgerrors.Wrap(err, "Getting Configs Information")
- }
-
inst.Status = "PRE-DELETE"
inst.HookProgress = ""
err = db.DBconn.Update(v.storeName, key, v.tagInst, inst)
@@ -751,15 +746,10 @@ func (v *InstanceClient) Delete(id string) error {
log.Printf("Update Instance DB Entry for release %s has error.", inst.ReleaseName)
}
- if len(configs) > 0 {
- log.Printf("Deleting config resources first")
- for _, config := range configs {
- log.Printf("Deleting Config %s Resources", config.ConfigName)
- _, err = configClient.Delete(id, config.ConfigName)
- if err != nil {
- return pkgerrors.Wrap(err, "Deleting Config Resources")
- }
- }
+ configClient := NewConfigClient()
+ err = configClient.Cleanup(id)
+ if err != nil {
+ return pkgerrors.Wrap(err, "Cleanup Config Resources")
}
err = k8sClient.deleteResources(inst.Resources, inst.Namespace)