summaryrefslogtreecommitdiffstats
path: root/src/k8splugin
diff options
context:
space:
mode:
authorKiran Kamineni <kiran.k.kamineni@intel.com>2019-01-17 16:23:58 -0800
committerKiran Kamineni <kiran.k.kamineni@intel.com>2019-01-18 16:36:22 -0800
commita9c4fe27e959c61e6c447d68757fd49da38256ac (patch)
tree26912e834b9f47981f1164e41bd3a5f68e2bc7f2 /src/k8splugin
parent002602dc6b09d4012fbca05740eb4e4dbb9ce6ce (diff)
Delete content when a definition is deleted
When a definition is deleted, delete the content too. Not deleting the content would leave blobs of data that is not connected to any metadata in the mongo database. Issue-ID: MULTICLOUD-393 Change-Id: Ifae55bab0affc22b06b1069a27cd90af6f7d5d98 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src/k8splugin')
-rw-r--r--src/k8splugin/rb/definition.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/k8splugin/rb/definition.go b/src/k8splugin/rb/definition.go
index eb7a12fc..91419bf1 100644
--- a/src/k8splugin/rb/definition.go
+++ b/src/k8splugin/rb/definition.go
@@ -129,6 +129,12 @@ func (v *DefinitionClient) Delete(id string) error {
return pkgerrors.Wrap(err, "Delete Resource Bundle Definition")
}
+ //Delete the content when the delete operation happens
+ err = db.DBconn.Delete(v.storeName, id, v.tagContent)
+ if err != nil {
+ return pkgerrors.Wrap(err, "Delete Resource Bundle Definition Content")
+ }
+
return nil
}