[VOL-3801] remove consul support
Bump up voltha-lib-go version to remove consul
voltha-protos version is updated automatically by mod-update
Change-Id: Ifad40dc54fb03b1e40ea9f5fe46344dacb2527ee
diff --git a/internal/pkg/core/openolt_test.go b/internal/pkg/core/openolt_test.go
index bf4aa9a..3933475 100644
--- a/internal/pkg/core/openolt_test.go
+++ b/internal/pkg/core/openolt_test.go
@@ -25,10 +25,11 @@
import (
"context"
"errors"
- conf "github.com/opencord/voltha-lib-go/v4/pkg/config"
"reflect"
"testing"
+ conf "github.com/opencord/voltha-lib-go/v4/pkg/config"
+
com "github.com/opencord/voltha-lib-go/v4/pkg/adapters/common"
"github.com/opencord/voltha-lib-go/v4/pkg/events"
fu "github.com/opencord/voltha-lib-go/v4/pkg/flows"
@@ -104,12 +105,10 @@
cm *conf.ConfigManager
want *OpenOLT
}{
- {"newopenolt-1", &fields{}, &config.AdapterFlags{OnuNumber: 1, KVStoreAddress: "1.1.1.1:1", KVStoreType: "consul"}, &conf.ConfigManager{},
- &OpenOLT{numOnus: 1, KVStoreAddress: "1.1.1.1:1", KVStoreType: "consul"}},
+ {"newopenolt-1", &fields{}, &config.AdapterFlags{OnuNumber: 1, KVStoreAddress: "1.1.1.1:1", KVStoreType: "etcd"}, &conf.ConfigManager{},
+ &OpenOLT{numOnus: 1, KVStoreAddress: "1.1.1.1:1", KVStoreType: "etcd"}},
{"newopenolt-2", &fields{}, &config.AdapterFlags{OnuNumber: 2, KVStoreAddress: "2.2.2.2:2", KVStoreType: "etcd"}, &conf.ConfigManager{},
&OpenOLT{numOnus: 2, KVStoreAddress: "2.2.2.2:2", KVStoreType: "etcd"}},
- {"newopenolt-3", &fields{}, &config.AdapterFlags{OnuNumber: 3, KVStoreAddress: "3.3.3.3:3", KVStoreType: "consul"}, &conf.ConfigManager{},
- &OpenOLT{numOnus: 3, KVStoreAddress: "3.3.3.3:3", KVStoreType: "consul"}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
diff --git a/internal/pkg/resourcemanager/resourcemanager.go b/internal/pkg/resourcemanager/resourcemanager.go
index 5f88472..140bbc8 100755
--- a/internal/pkg/resourcemanager/resourcemanager.go
+++ b/internal/pkg/resourcemanager/resourcemanager.go
@@ -131,8 +131,6 @@
func newKVClient(ctx context.Context, storeType string, address string, timeout time.Duration) (kvstore.Client, error) {
logger.Infow(ctx, "kv-store-type", log.Fields{"store": storeType})
switch storeType {
- case "consul":
- return kvstore.NewConsulClient(ctx, address, timeout)
case "etcd":
return kvstore.NewEtcdClient(ctx, address, timeout, log.FatalLevel)
}
diff --git a/internal/pkg/resourcemanager/resourcemanager_test.go b/internal/pkg/resourcemanager/resourcemanager_test.go
index 50fcf4a..bef6709 100644
--- a/internal/pkg/resourcemanager/resourcemanager_test.go
+++ b/internal/pkg/resourcemanager/resourcemanager_test.go
@@ -27,6 +27,13 @@
"context"
"encoding/json"
"errors"
+ "reflect"
+ "strconv"
+ "strings"
+ "sync"
+ "testing"
+ "time"
+
"github.com/opencord/voltha-lib-go/v4/pkg/db"
"github.com/opencord/voltha-lib-go/v4/pkg/db/kvstore"
fu "github.com/opencord/voltha-lib-go/v4/pkg/flows"
@@ -34,12 +41,6 @@
ponrmgr "github.com/opencord/voltha-lib-go/v4/pkg/ponresourcemanager"
ofp "github.com/opencord/voltha-protos/v4/go/openflow_13"
"github.com/opencord/voltha-protos/v4/go/openolt"
- "reflect"
- "strconv"
- "strings"
- "sync"
- "testing"
- "time"
)
func init() {
@@ -200,6 +201,11 @@
return nil
}
+// DeleteWithPrefix mock function implementation for KVClient
+func (kvclient *MockResKVClient) DeleteWithPrefix(ctx context.Context, prefix string) error {
+ return nil
+}
+
// Reserve mock function implementation for KVClient
func (kvclient *MockResKVClient) Reserve(ctx context.Context, key string, value interface{}, ttl time.Duration) (interface{}, error) {
return nil, errors.New("key didn't find")
@@ -281,9 +287,7 @@
args args
want *OpenOltResourceMgr
}{
- {"NewResourceMgr-1", args{"olt1", "1:2", "consul",
- "onu", &openolt.DeviceInfo{OnuIdStart: 1, OnuIdEnd: 1}, "service/voltha"}, &OpenOltResourceMgr{}},
- {"NewResourceMgr-2", args{"olt2", "3:4", "etcd",
+ {"NewResourceMgr-2", args{"olt1", "1:2", "etcd",
"onu", &openolt.DeviceInfo{OnuIdStart: 1, OnuIdEnd: 1}, "service/voltha"}, &OpenOltResourceMgr{}},
}
for _, tt := range tests {
@@ -838,8 +842,7 @@
args args
want *db.Backend
}{
- {"setKVClient-1", args{"consul", "1.1.1.1:1", "olt1", "service/voltha"}, &db.Backend{}},
- {"setKVClient-1", args{"etcd", "2.2.2.2:2", "olt2", "service/voltha"}, &db.Backend{}},
+ {"setKVClient-1", args{"etcd", "1.1.1.1:1", "olt1", "service/voltha"}, &db.Backend{}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {