diff options
author | Lukasz Rajewski <lukasz.rajewski@orange.com> | 2021-10-01 09:35:35 +0200 |
---|---|---|
committer | Lukasz Rajewski <lukasz.rajewski@orange.com> | 2021-10-04 12:06:25 +0200 |
commit | bbeac9a596074d0af6e5be60448567517978a388 (patch) | |
tree | a3e0203797e00e6db9e31001e316e238a77d775a /src/k8splugin/internal/app/instance.go | |
parent | dc62323aa7f6782d69c7ac6509eb270e86ef31bd (diff) |
Further fixes for config delete operation
The issue was related with insufficient handlijg of
different versions of config vs their delete operation
handled by the plugin.
Issue-ID: MULTICLOUD-1332
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
Change-Id: I90d896720fa89ebd66cb3290cdd9401272f5e3fd
Diffstat (limited to 'src/k8splugin/internal/app/instance.go')
-rw-r--r-- | src/k8splugin/internal/app/instance.go | 22 |
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) |