Migrating from consul to mongodb for backend 73/74473/15
authorKiran Kamineni <kiran.k.kamineni@intel.com>
Mon, 10 Dec 2018 21:34:16 +0000 (13:34 -0800)
committerKiran Kamineni <kiran.k.kamineni@intel.com>
Fri, 14 Dec 2018 22:26:26 +0000 (14:26 -0800)
commitd203ccf9174e450b6f5a6a9aabea95b73c9973ff
tree702034eafbd28b47f33023607ee213cf92519a99
parentaa56022e0fba3c358e46e8671d9a0cd36094ebaa
Migrating from consul to mongodb for backend

Migrating to mongodb from consul.
The main reason being the value size limitation of 512kb in consul.
See https://jira.onap.org/browse/MULTICLOUD-426 for details.
This requires a little bit of hierarchy management
and data management.
We are no longer converting structs to json encoded
strings. The underlying db supports structs without any modifications.
Also, since Mongo has the concept of collections, each submodule can
use its own collection for storage as needed.
Definition uses a collection called rbdef right now.
P10: Enabling unit tests for mongo.go. This requires the usage
     of aliased functions.
P11: Expanded unit tests for all functions in mongo.go
P12: Refactored parameter validation.
     Removed TestHealthCheck as we are not mocking any of the
       db commands right now
     Checking return value of read with an expected value
P13: Adding back consul support.
     Fixing functional test
     Full consul implementation check and modifications is
     being tracked by MULTICLOUD-427
P15: Fix ReadAll unit test and corresponding code
     ReadAll now returns error when no objects are found

Issue-ID: MULTICLOUD-426
Change-Id: I42d239b324025fc4ef4e561790aceeff794001ef
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
16 files changed:
deployments/docker-compose.yml
deployments/start.sh
src/k8splugin/api/handler.go
src/k8splugin/api/handler_test.go
src/k8splugin/db/consul.go
src/k8splugin/db/consul_test.go
src/k8splugin/db/mongo.go [new file with mode: 0644]
src/k8splugin/db/mongo_test.go [new file with mode: 0644]
src/k8splugin/db/store.go
src/k8splugin/db/store_test.go
src/k8splugin/db/testing.go
src/k8splugin/go.mod
src/k8splugin/go.sum
src/k8splugin/rb/definition.go
src/k8splugin/rb/definition_test.go
vagrant/tests/plugin.sh