From a9c4fe27e959c61e6c447d68757fd49da38256ac Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Thu, 17 Jan 2019 16:23:58 -0800 Subject: 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 --- src/k8splugin/rb/definition.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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 } -- cgit 1.2.3-korg