From: Kiran Kamineni Date: Fri, 18 Jan 2019 00:23:58 +0000 (-0800) Subject: Delete content when a definition is deleted X-Git-Tag: 0.1.0~77^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F68%2F75968%2F2;p=multicloud%2Fk8s.git 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 --- 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 }