summaryrefslogtreecommitdiffstats
path: root/src/k8splugin
diff options
context:
space:
mode:
Diffstat (limited to 'src/k8splugin')
-rw-r--r--src/k8splugin/db/mongo.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/k8splugin/db/mongo.go b/src/k8splugin/db/mongo.go
index 311f044c..65e721c3 100644
--- a/src/k8splugin/db/mongo.go
+++ b/src/k8splugin/db/mongo.go
@@ -224,6 +224,11 @@ func (m *MongoStore) Delete(coll, key, tag string) error {
keydata, err := decodeBytes(c.FindOneAndUpdate(ctx, filter, update,
options.FindOneAndUpdate().SetReturnDocument(options.Before)))
if err != nil {
+ //No document was found. Return nil.
+ if err == mongo.ErrNoDocuments {
+ return nil
+ }
+ //Return any other error that was found.
return pkgerrors.Errorf("Error decoding master table after update: %s",
err.Error())
}