diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/k8splugin/db/mongo.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/k8splugin/db/mongo.go b/src/k8splugin/db/mongo.go index 65e721c3..05976b12 100644 --- a/src/k8splugin/db/mongo.go +++ b/src/k8splugin/db/mongo.go @@ -183,7 +183,13 @@ func (m *MongoStore) Read(coll, key, tag string) ([]byte, error) { } //Return the data as a byte array - return tagdata.Lookup(tag).Value, nil + //Convert string data to byte array using the built-in functions + switch tagdata.Lookup(tag).Type { + case bson.TypeString: + return []byte(tagdata.Lookup(tag).StringValue()), nil + default: + return tagdata.Lookup(tag).Value, nil + } } // Helper function that deletes an object by its ID |