summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/internal/db/mongo.go
diff options
context:
space:
mode:
authorBin Yang <bin.yang@windriver.com>2019-04-23 02:02:41 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-23 02:02:42 +0000
commita767721c447a624cebdec811795475fd5345b9ff (patch)
tree6ef6f81aba957dc4aba1f7311fb1a18cd07c08f0 /src/k8splugin/internal/db/mongo.go
parentce36e99a466993bdbbfba8a235db52e565da3340 (diff)
parent42f8f006ab01692d7de9cecc06521eaf58743c0d (diff)
Merge "Move configuration into config files"
Diffstat (limited to 'src/k8splugin/internal/db/mongo.go')
-rw-r--r--src/k8splugin/internal/db/mongo.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/k8splugin/internal/db/mongo.go b/src/k8splugin/internal/db/mongo.go
index a9e9d98a..d4525222 100644
--- a/src/k8splugin/internal/db/mongo.go
+++ b/src/k8splugin/internal/db/mongo.go
@@ -19,7 +19,8 @@ package db
import (
"golang.org/x/net/context"
"log"
- "os"
+
+ "k8splugin/internal/config"
pkgerrors "github.com/pkg/errors"
"go.mongodb.org/mongo-driver/bson"
@@ -76,7 +77,7 @@ var cursorClose = func(ctx context.Context, cursor *mongo.Cursor) error {
// If a database with that name exists, it will be returned
func NewMongoStore(name string, store *mongo.Database) (Store, error) {
if store == nil {
- ip := "mongodb://" + os.Getenv("DATABASE_IP") + ":27017"
+ ip := "mongodb://" + config.GetConfiguration().DatabaseAddress + ":27017"
clientOptions := options.Client()
clientOptions.ApplyURI(ip)
mongoClient, err := mongo.NewClient(clientOptions)