VOL-2180 code changes for context addition
Integrating InterContainerProxy interface changes
Change-Id: Ia20c5ac3093b7845acf80cce801ec0c1d90c125f
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/adapters/common/adapter_proxy.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/adapters/common/adapter_proxy.go
index b302214..02fa3de 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/adapters/common/adapter_proxy.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/adapters/common/adapter_proxy.go
@@ -29,12 +29,12 @@
)
type AdapterProxy struct {
- kafkaICProxy *kafka.InterContainerProxy
+ kafkaICProxy kafka.InterContainerProxy
adapterTopic string
coreTopic string
}
-func NewAdapterProxy(kafkaProxy *kafka.InterContainerProxy, adapterTopic string, coreTopic string) *AdapterProxy {
+func NewAdapterProxy(kafkaProxy kafka.InterContainerProxy, adapterTopic string, coreTopic string) *AdapterProxy {
var proxy AdapterProxy
proxy.kafkaICProxy = kafkaProxy
proxy.adapterTopic = adapterTopic
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/adapters/common/core_proxy.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/adapters/common/core_proxy.go
index 9b46c28..c5e1c14 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/adapters/common/core_proxy.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/adapters/common/core_proxy.go
@@ -30,14 +30,14 @@
)
type CoreProxy struct {
- kafkaICProxy *kafka.InterContainerProxy
+ kafkaICProxy kafka.InterContainerProxy
adapterTopic string
coreTopic string
deviceIdCoreMap map[string]string
lockDeviceIdCoreMap sync.RWMutex
}
-func NewCoreProxy(kafkaProxy *kafka.InterContainerProxy, adapterTopic string, coreTopic string) *CoreProxy {
+func NewCoreProxy(kafkaProxy kafka.InterContainerProxy, adapterTopic string, coreTopic string) *CoreProxy {
var proxy CoreProxy
proxy.kafkaICProxy = kafkaProxy
proxy.adapterTopic = adapterTopic
@@ -431,8 +431,14 @@
logger.Warnw("cannot-unmarshal-response", log.Fields{"error": err})
}
logger.Debugw("GetChildDevice-return", log.Fields{"deviceid": parentDeviceId, "success": success, "error": err})
- // TODO: Need to get the real error code
- return nil, status.Errorf(codes.Internal, "%s", unpackResult.Reason)
+
+ code := codes.Internal
+
+ if unpackResult.Code == ic.ErrorCode_DEADLINE_EXCEEDED {
+ code = codes.DeadlineExceeded
+ }
+
+ return nil, status.Errorf(code, "%s", unpackResult.Reason)
}
}
@@ -467,8 +473,14 @@
logger.Warnw("cannot-unmarshal-response", log.Fields{"error": err})
}
logger.Debugw("GetChildDevices-return", log.Fields{"deviceid": parentDeviceId, "success": success, "error": err})
- // TODO: Need to get the real error code
- return nil, status.Errorf(codes.Internal, "%s", unpackResult.Reason)
+
+ code := codes.Internal
+
+ if unpackResult.Code == ic.ErrorCode_DEADLINE_EXCEEDED {
+ code = codes.DeadlineExceeded
+ }
+
+ return nil, status.Errorf(code, "%s", unpackResult.Reason)
}
}
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/backend.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/backend.go
index 23ad5a0..9bb49ac 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/backend.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/backend.go
@@ -119,8 +119,8 @@
// Perform a dummy Key Lookup on kvstore to test Connection Liveness and
// post on Liveness channel
-func (b *Backend) PerformLivenessCheck(timeout int) bool {
- alive := b.Client.IsConnectionUp(timeout)
+func (b *Backend) PerformLivenessCheck(ctx context.Context) bool {
+ alive := b.Client.IsConnectionUp(ctx)
logger.Debugw("kvstore-liveness-check-result", log.Fields{"alive": alive})
b.updateLiveness(alive)
@@ -187,14 +187,14 @@
}
// List retrieves one or more items that match the specified key
-func (b *Backend) List(key string) (map[string]*kvstore.KVPair, error) {
+func (b *Backend) List(ctx context.Context, key string) (map[string]*kvstore.KVPair, error) {
b.Lock()
defer b.Unlock()
formattedPath := b.makePath(key)
logger.Debugw("listing-key", log.Fields{"key": key, "path": formattedPath})
- pair, err := b.Client.List(formattedPath, b.Timeout)
+ pair, err := b.Client.List(ctx, formattedPath)
b.updateLiveness(b.isErrorIndicatingAliveKvstore(err))
@@ -202,14 +202,14 @@
}
// Get retrieves an item that matches the specified key
-func (b *Backend) Get(key string) (*kvstore.KVPair, error) {
+func (b *Backend) Get(ctx context.Context, key string) (*kvstore.KVPair, error) {
b.Lock()
defer b.Unlock()
formattedPath := b.makePath(key)
logger.Debugw("getting-key", log.Fields{"key": key, "path": formattedPath})
- pair, err := b.Client.Get(formattedPath, b.Timeout)
+ pair, err := b.Client.Get(ctx, formattedPath)
b.updateLiveness(b.isErrorIndicatingAliveKvstore(err))
@@ -217,14 +217,14 @@
}
// Put stores an item value under the specifed key
-func (b *Backend) Put(key string, value interface{}) error {
+func (b *Backend) Put(ctx context.Context, key string, value interface{}) error {
b.Lock()
defer b.Unlock()
formattedPath := b.makePath(key)
logger.Debugw("putting-key", log.Fields{"key": key, "value": string(value.([]byte)), "path": formattedPath})
- err := b.Client.Put(formattedPath, value, b.Timeout)
+ err := b.Client.Put(ctx, formattedPath, value)
b.updateLiveness(b.isErrorIndicatingAliveKvstore(err))
@@ -232,14 +232,14 @@
}
// Delete removes an item under the specified key
-func (b *Backend) Delete(key string) error {
+func (b *Backend) Delete(ctx context.Context, key string) error {
b.Lock()
defer b.Unlock()
formattedPath := b.makePath(key)
logger.Debugw("deleting-key", log.Fields{"key": key, "path": formattedPath})
- err := b.Client.Delete(formattedPath, b.Timeout)
+ err := b.Client.Delete(ctx, formattedPath)
b.updateLiveness(b.isErrorIndicatingAliveKvstore(err))
@@ -247,14 +247,14 @@
}
// CreateWatch starts watching events for the specified key
-func (b *Backend) CreateWatch(key string) chan *kvstore.Event {
+func (b *Backend) CreateWatch(ctx context.Context, key string) chan *kvstore.Event {
b.Lock()
defer b.Unlock()
formattedPath := b.makePath(key)
logger.Debugw("creating-key-watch", log.Fields{"key": key, "path": formattedPath})
- return b.Client.Watch(formattedPath)
+ return b.Client.Watch(ctx, formattedPath)
}
// DeleteWatch stops watching events for the specified key
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore/client.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore/client.go
index 088593a..d30e049 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore/client.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore/client.go
@@ -15,6 +15,8 @@
*/
package kvstore
+import "context"
+
const (
// Default timeout in seconds when making a kvstore request
defaultKVGetTimeout = 5
@@ -71,18 +73,18 @@
// Client represents the set of APIs a KV Client must implement
type Client interface {
- List(key string, timeout int) (map[string]*KVPair, error)
- Get(key string, timeout int) (*KVPair, error)
- Put(key string, value interface{}, timeout int) error
- Delete(key string, timeout int) error
- Reserve(key string, value interface{}, ttl int64) (interface{}, error)
- ReleaseReservation(key string) error
- ReleaseAllReservations() error
- RenewReservation(key string) error
- Watch(key string) chan *Event
- AcquireLock(lockName string, timeout int) error
+ List(ctx context.Context, key string) (map[string]*KVPair, error)
+ Get(ctx context.Context, key string) (*KVPair, error)
+ Put(ctx context.Context, key string, value interface{}) error
+ Delete(ctx context.Context, key string) error
+ Reserve(ctx context.Context, key string, value interface{}, ttl int64) (interface{}, error)
+ ReleaseReservation(ctx context.Context, key string) error
+ ReleaseAllReservations(ctx context.Context) error
+ RenewReservation(ctx context.Context, key string) error
+ Watch(ctx context.Context, key string) chan *Event
+ AcquireLock(ctx context.Context, lockName string, timeout int) error
ReleaseLock(lockName string) error
- IsConnectionUp(timeout int) bool // timeout in second
+ IsConnectionUp(ctx context.Context) bool // timeout in second
CloseWatch(key string, ch chan *Event)
Close()
}
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore/consulclient.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore/consulclient.go
index e391293..fdf39be 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore/consulclient.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore/consulclient.go
@@ -64,19 +64,19 @@
}
// IsConnectionUp returns whether the connection to the Consul KV store is up
-func (c *ConsulClient) IsConnectionUp(timeout int) bool {
+func (c *ConsulClient) IsConnectionUp(ctx context.Context) bool {
logger.Error("Unimplemented function")
return false
}
// List returns an array of key-value pairs with key as a prefix. Timeout defines how long the function will
// wait for a response
-func (c *ConsulClient) List(key string, timeout int) (map[string]*KVPair, error) {
- duration := GetDuration(timeout)
+func (c *ConsulClient) List(ctx context.Context, key string) (map[string]*KVPair, error) {
+ deadline, _ := ctx.Deadline()
kv := c.consul.KV()
var queryOptions consulapi.QueryOptions
- queryOptions.WaitTime = duration
+ queryOptions.WaitTime = GetDuration(deadline.Second())
// For now we ignore meta data
kvps, _, err := kv.List(key, &queryOptions)
if err != nil {
@@ -92,13 +92,12 @@
// Get returns a key-value pair for a given key. Timeout defines how long the function will
// wait for a response
-func (c *ConsulClient) Get(key string, timeout int) (*KVPair, error) {
+func (c *ConsulClient) Get(ctx context.Context, key string) (*KVPair, error) {
- duration := GetDuration(timeout)
-
+ deadline, _ := ctx.Deadline()
kv := c.consul.KV()
var queryOptions consulapi.QueryOptions
- queryOptions.WaitTime = duration
+ queryOptions.WaitTime = GetDuration(deadline.Second())
// For now we ignore meta data
kvp, _, err := kv.Get(key, &queryOptions)
if err != nil {
@@ -115,7 +114,7 @@
// Put writes a key-value pair to the KV store. Value can only be a string or []byte since the consul API
// accepts only a []byte as a value for a put operation. Timeout defines how long the function will
// wait for a response
-func (c *ConsulClient) Put(key string, value interface{}, timeout int) error {
+func (c *ConsulClient) Put(ctx context.Context, key string, value interface{}) error {
// Validate that we can create a byte array from the value as consul API expects a byte array
var val []byte
@@ -141,7 +140,7 @@
// Delete removes a key from the KV store. Timeout defines how long the function will
// wait for a response
-func (c *ConsulClient) Delete(key string, timeout int) error {
+func (c *ConsulClient) Delete(ctx context.Context, key string) error {
kv := c.consul.KV()
var writeOptions consulapi.WriteOptions
c.writeLock.Lock()
@@ -219,7 +218,7 @@
// defines how long that reservation is valid. When TTL expires the key is unreserved by the KV store itself.
// If the key is acquired then the value returned will be the value passed in. If the key is already acquired
// then the value assigned to that key will be returned.
-func (c *ConsulClient) Reserve(key string, value interface{}, ttl int64) (interface{}, error) {
+func (c *ConsulClient) Reserve(ctx context.Context, key string, value interface{}, ttl int64) (interface{}, error) {
// Validate that we can create a byte array from the value as consul API expects a byte array
var val []byte
@@ -264,7 +263,7 @@
logger.Debugw("key-acquired", log.Fields{"key": key, "status": result})
// Irrespective whether we were successful in acquiring the key, let's read it back and see if it's us.
- m, err := c.Get(key, defaultKVGetTimeout)
+ m, err := c.Get(ctx, key)
if err != nil {
return nil, err
}
@@ -286,7 +285,7 @@
}
// ReleaseAllReservations releases all key reservations previously made (using Reserve API)
-func (c *ConsulClient) ReleaseAllReservations() error {
+func (c *ConsulClient) ReleaseAllReservations(ctx context.Context) error {
kv := c.consul.KV()
var kvp consulapi.KVPair
var result bool
@@ -311,7 +310,7 @@
}
// ReleaseReservation releases reservation for a specific key.
-func (c *ConsulClient) ReleaseReservation(key string) error {
+func (c *ConsulClient) ReleaseReservation(ctx context.Context, key string) error {
var ok bool
var reservedValue interface{}
c.writeLock.Lock()
@@ -337,7 +336,7 @@
// RenewReservation renews a reservation. A reservation will go stale after the specified TTL (Time To Live)
// period specified when reserving the key
-func (c *ConsulClient) RenewReservation(key string) error {
+func (c *ConsulClient) RenewReservation(ctx context.Context, key string) error {
// In the case of Consul, renew reservation of a reserve key only require renewing the client session.
c.writeLock.Lock()
@@ -361,7 +360,7 @@
// Watch provides the watch capability on a given key. It returns a channel onto which the callee needs to
// listen to receive Events.
-func (c *ConsulClient) Watch(key string) chan *Event {
+func (c *ConsulClient) Watch(ctx context.Context, key string) chan *Event {
// Create a new channel
ch := make(chan *Event, maxClientChannelBufferSize)
@@ -504,7 +503,7 @@
}
}
-func (c *ConsulClient) AcquireLock(lockName string, timeout int) error {
+func (c *ConsulClient) AcquireLock(ctx context.Context, lockName string, timeout int) error {
return nil
}
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore/etcdclient.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore/etcdclient.go
index 7096748..a0f39cd 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore/etcdclient.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore/etcdclient.go
@@ -19,11 +19,12 @@
"context"
"errors"
"fmt"
+ "sync"
+
"github.com/opencord/voltha-lib-go/v3/pkg/log"
v3Client "go.etcd.io/etcd/clientv3"
v3Concurrency "go.etcd.io/etcd/clientv3/concurrency"
v3rpcTypes "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes"
- "sync"
)
// EtcdClient represents the Etcd KV store client
@@ -64,23 +65,19 @@
// IsConnectionUp returns whether the connection to the Etcd KV store is up. If a timeout occurs then
// it is assumed the connection is down or unreachable.
-func (c *EtcdClient) IsConnectionUp(timeout int) bool {
+func (c *EtcdClient) IsConnectionUp(ctx context.Context) bool {
// Let's try to get a non existent key. If the connection is up then there will be no error returned.
- if _, err := c.Get("non-existent-key", timeout); err != nil {
+ if _, err := c.Get(ctx, "non-existent-key"); err != nil {
return false
}
+ //cancel()
return true
}
// List returns an array of key-value pairs with key as a prefix. Timeout defines how long the function will
// wait for a response
-func (c *EtcdClient) List(key string, timeout int) (map[string]*KVPair, error) {
- duration := GetDuration(timeout)
-
- ctx, cancel := context.WithTimeout(context.Background(), duration)
-
+func (c *EtcdClient) List(ctx context.Context, key string) (map[string]*KVPair, error) {
resp, err := c.ectdAPI.Get(ctx, key, v3Client.WithPrefix())
- cancel()
if err != nil {
logger.Error(err)
return nil, err
@@ -94,13 +91,10 @@
// Get returns a key-value pair for a given key. Timeout defines how long the function will
// wait for a response
-func (c *EtcdClient) Get(key string, timeout int) (*KVPair, error) {
- duration := GetDuration(timeout)
-
- ctx, cancel := context.WithTimeout(context.Background(), duration)
+func (c *EtcdClient) Get(ctx context.Context, key string) (*KVPair, error) {
resp, err := c.ectdAPI.Get(ctx, key)
- cancel()
+
if err != nil {
logger.Error(err)
return nil, err
@@ -115,7 +109,7 @@
// Put writes a key-value pair to the KV store. Value can only be a string or []byte since the etcd API
// accepts only a string as a value for a put operation. Timeout defines how long the function will
// wait for a response
-func (c *EtcdClient) Put(key string, value interface{}, timeout int) error {
+func (c *EtcdClient) Put(ctx context.Context, key string, value interface{}) error {
// Validate that we can convert value to a string as etcd API expects a string
var val string
@@ -124,10 +118,6 @@
return fmt.Errorf("unexpected-type-%T", value)
}
- duration := GetDuration(timeout)
-
- ctx, cancel := context.WithTimeout(context.Background(), duration)
-
c.writeLock.Lock()
defer c.writeLock.Unlock()
@@ -139,7 +129,7 @@
} else {
_, err = c.ectdAPI.Put(ctx, key, val)
}
- cancel()
+
if err != nil {
switch err {
case context.Canceled:
@@ -158,13 +148,7 @@
// Delete removes a key from the KV store. Timeout defines how long the function will
// wait for a response
-func (c *EtcdClient) Delete(key string, timeout int) error {
-
- duration := GetDuration(timeout)
-
- ctx, cancel := context.WithTimeout(context.Background(), duration)
-
- defer cancel()
+func (c *EtcdClient) Delete(ctx context.Context, key string) error {
c.writeLock.Lock()
defer c.writeLock.Unlock()
@@ -183,7 +167,7 @@
// defines how long that reservation is valid. When TTL expires the key is unreserved by the KV store itself.
// If the key is acquired then the value returned will be the value passed in. If the key is already acquired
// then the value assigned to that key will be returned.
-func (c *EtcdClient) Reserve(key string, value interface{}, ttl int64) (interface{}, error) {
+func (c *EtcdClient) Reserve(ctx context.Context, key string, value interface{}, ttl int64) (interface{}, error) {
// Validate that we can convert value to a string as etcd API expects a string
var val string
var er error
@@ -191,12 +175,6 @@
return nil, fmt.Errorf("unexpected-type%T", value)
}
- duration := GetDuration(connTimeout)
-
- // Create a lease
- ctx, cancel := context.WithTimeout(context.Background(), duration)
- defer cancel()
-
resp, err := c.ectdAPI.Grant(ctx, ttl)
if err != nil {
logger.Error(err)
@@ -211,7 +189,7 @@
reservationSuccessful := false
defer func() {
if !reservationSuccessful {
- if err = c.ReleaseReservation(key); err != nil {
+ if err = c.ReleaseReservation(context.Background(), key); err != nil {
logger.Error("cannot-release-lease")
}
}
@@ -241,7 +219,7 @@
}
} else {
// Read the Key to ensure this is our Key
- m, err := c.Get(key, defaultKVGetTimeout)
+ m, err := c.Get(ctx, key)
if err != nil {
return nil, err
}
@@ -260,12 +238,9 @@
}
// ReleaseAllReservations releases all key reservations previously made (using Reserve API)
-func (c *EtcdClient) ReleaseAllReservations() error {
+func (c *EtcdClient) ReleaseAllReservations(ctx context.Context) error {
c.writeLock.Lock()
defer c.writeLock.Unlock()
- duration := GetDuration(connTimeout)
- ctx, cancel := context.WithTimeout(context.Background(), duration)
- defer cancel()
for key, leaseID := range c.keyReservations {
_, err := c.ectdAPI.Revoke(ctx, *leaseID)
@@ -279,7 +254,7 @@
}
// ReleaseReservation releases reservation for a specific key.
-func (c *EtcdClient) ReleaseReservation(key string) error {
+func (c *EtcdClient) ReleaseReservation(ctx context.Context, key string) error {
// Get the leaseid using the key
logger.Debugw("Release-reservation", log.Fields{"key": key})
var ok bool
@@ -289,9 +264,6 @@
if leaseID, ok = c.keyReservations[key]; !ok {
return nil
}
- duration := GetDuration(connTimeout)
- ctx, cancel := context.WithTimeout(context.Background(), duration)
- defer cancel()
if leaseID != nil {
_, err := c.ectdAPI.Revoke(ctx, *leaseID)
@@ -306,7 +278,7 @@
// RenewReservation renews a reservation. A reservation will go stale after the specified TTL (Time To Live)
// period specified when reserving the key
-func (c *EtcdClient) RenewReservation(key string) error {
+func (c *EtcdClient) RenewReservation(ctx context.Context, key string) error {
// Get the leaseid using the key
var ok bool
var leaseID *v3Client.LeaseID
@@ -315,9 +287,6 @@
if leaseID, ok = c.keyReservations[key]; !ok {
return errors.New("key-not-reserved")
}
- duration := GetDuration(connTimeout)
- ctx, cancel := context.WithTimeout(context.Background(), duration)
- defer cancel()
if leaseID != nil {
_, err := c.ectdAPI.KeepAliveOnce(ctx, *leaseID)
@@ -333,9 +302,9 @@
// Watch provides the watch capability on a given key. It returns a channel onto which the callee needs to
// listen to receive Events.
-func (c *EtcdClient) Watch(key string) chan *Event {
+func (c *EtcdClient) Watch(ctx context.Context, key string) chan *Event {
w := v3Client.NewWatcher(c.ectdAPI)
- ctx, cancel := context.WithCancel(context.Background())
+ ctx, cancel := context.WithCancel(ctx)
channel := w.Watch(ctx, key)
// Create a new channel
@@ -490,14 +459,11 @@
return lock, session
}
-func (c *EtcdClient) AcquireLock(lockName string, timeout int) error {
- duration := GetDuration(timeout)
- ctx, cancel := context.WithTimeout(context.Background(), duration)
- defer cancel()
+func (c *EtcdClient) AcquireLock(ctx context.Context, lockName string, timeout int) error {
session, _ := v3Concurrency.NewSession(c.ectdAPI, v3Concurrency.WithContext(ctx))
mu := v3Concurrency.NewMutex(session, "/devicelock_"+lockName)
if err := mu.Lock(context.Background()); err != nil {
- cancel()
+ //cancel()
return err
}
c.addLockName(lockName, mu, session)
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/client.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/client.go
index 6289043..9abad93 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/client.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/client.go
@@ -66,6 +66,7 @@
DeleteTopic(topic *Topic) error
Subscribe(topic *Topic, kvArgs ...*KVArg) (<-chan *ca.InterContainerMessage, error)
UnSubscribe(topic *Topic, ch <-chan *ca.InterContainerMessage) error
+ SubscribeForMetadata(func(fromTopic string, timestamp int64))
Send(msg interface{}, topic *Topic, keys ...string) error
SendLiveness() error
EnableLivenessChannel(enable bool) chan bool
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/kafka_inter_container_library.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/kafka_inter_container_library.go
index 042e121..d21fdd5 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/kafka_inter_container_library.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/kafka_inter_container_library.go
@@ -60,15 +60,30 @@
ch chan *ic.InterContainerMessage
}
-// InterContainerProxy represents the messaging proxy
-type InterContainerProxy struct {
+type InterContainerProxy interface {
+ Start() error
+ Stop()
+ GetDefaultTopic() *Topic
+ DeviceDiscovered(deviceId string, deviceType string, parentId string, publisher string) error
+ InvokeRPC(ctx context.Context, rpc string, toTopic *Topic, replyToTopic *Topic, waitForResponse bool, key string, kvArgs ...*KVArg) (bool, *any.Any)
+ SubscribeWithRequestHandlerInterface(topic Topic, handler interface{}) error
+ SubscribeWithDefaultRequestHandler(topic Topic, initialOffset int64) error
+ UnSubscribeFromRequestHandler(topic Topic) error
+ DeleteTopic(topic Topic) error
+ EnableLivenessChannel(enable bool) chan bool
+ SendLiveness() error
+}
+
+// interContainerProxy represents the messaging proxy
+type interContainerProxy struct {
kafkaHost string
kafkaPort int
- DefaultTopic *Topic
+ defaultTopic *Topic
defaultRequestHandlerInterface interface{}
deviceDiscoveryTopic *Topic
kafkaClient Client
- doneCh chan int
+ doneCh chan struct{}
+ doneOnce sync.Once
// This map is used to map a topic to an interface and channel. When a request is received
// on that channel (registered to the topic) then that interface is invoked.
@@ -87,63 +102,63 @@
lockTransactionIdToChannelMap sync.RWMutex
}
-type InterContainerProxyOption func(*InterContainerProxy)
+type InterContainerProxyOption func(*interContainerProxy)
func InterContainerHost(host string) InterContainerProxyOption {
- return func(args *InterContainerProxy) {
+ return func(args *interContainerProxy) {
args.kafkaHost = host
}
}
func InterContainerPort(port int) InterContainerProxyOption {
- return func(args *InterContainerProxy) {
+ return func(args *interContainerProxy) {
args.kafkaPort = port
}
}
func DefaultTopic(topic *Topic) InterContainerProxyOption {
- return func(args *InterContainerProxy) {
- args.DefaultTopic = topic
+ return func(args *interContainerProxy) {
+ args.defaultTopic = topic
}
}
func DeviceDiscoveryTopic(topic *Topic) InterContainerProxyOption {
- return func(args *InterContainerProxy) {
+ return func(args *interContainerProxy) {
args.deviceDiscoveryTopic = topic
}
}
func RequestHandlerInterface(handler interface{}) InterContainerProxyOption {
- return func(args *InterContainerProxy) {
+ return func(args *interContainerProxy) {
args.defaultRequestHandlerInterface = handler
}
}
func MsgClient(client Client) InterContainerProxyOption {
- return func(args *InterContainerProxy) {
+ return func(args *interContainerProxy) {
args.kafkaClient = client
}
}
-func NewInterContainerProxy(opts ...InterContainerProxyOption) (*InterContainerProxy, error) {
- proxy := &InterContainerProxy{
+func newInterContainerProxy(opts ...InterContainerProxyOption) *interContainerProxy {
+ proxy := &interContainerProxy{
kafkaHost: DefaultKafkaHost,
kafkaPort: DefaultKafkaPort,
+ doneCh: make(chan struct{}),
}
for _, option := range opts {
option(proxy)
}
- // Create the locks for all the maps
- proxy.lockTopicRequestHandlerChannelMap = sync.RWMutex{}
- proxy.lockTransactionIdToChannelMap = sync.RWMutex{}
- proxy.lockTopicResponseChannelMap = sync.RWMutex{}
-
- return proxy, nil
+ return proxy
}
-func (kp *InterContainerProxy) Start() error {
+func NewInterContainerProxy(opts ...InterContainerProxyOption) InterContainerProxy {
+ return newInterContainerProxy(opts...)
+}
+
+func (kp *interContainerProxy) Start() error {
logger.Info("Starting-Proxy")
// Kafka MsgClient should already have been created. If not, output fatal error
@@ -151,9 +166,6 @@
logger.Fatal("kafka-client-not-set")
}
- // Create the Done channel
- kp.doneCh = make(chan int, 1)
-
// Start the kafka client
if err := kp.kafkaClient.Start(); err != nil {
logger.Errorw("Cannot-create-kafka-proxy", log.Fields{"error": err})
@@ -172,9 +184,9 @@
return nil
}
-func (kp *InterContainerProxy) Stop() {
+func (kp *interContainerProxy) Stop() {
logger.Info("stopping-intercontainer-proxy")
- kp.doneCh <- 1
+ kp.doneOnce.Do(func() { close(kp.doneCh) })
// TODO : Perform cleanup
kp.kafkaClient.Stop()
//kp.deleteAllTopicRequestHandlerChannelMap()
@@ -182,8 +194,12 @@
//kp.deleteAllTransactionIdToChannelMap()
}
+func (kp *interContainerProxy) GetDefaultTopic() *Topic {
+ return kp.defaultTopic
+}
+
// DeviceDiscovered publish the discovered device onto the kafka messaging bus
-func (kp *InterContainerProxy) DeviceDiscovered(deviceId string, deviceType string, parentId string, publisher string) error {
+func (kp *interContainerProxy) DeviceDiscovered(deviceId string, deviceType string, parentId string, publisher string) error {
logger.Debugw("sending-device-discovery-msg", log.Fields{"deviceId": deviceId})
// Simple validation
if deviceId == "" || deviceType == "" {
@@ -194,7 +210,7 @@
header := &ic.Header{
Id: uuid.New().String(),
Type: ic.MessageType_DEVICE_DISCOVERED,
- FromTopic: kp.DefaultTopic.Name,
+ FromTopic: kp.defaultTopic.Name,
ToTopic: kp.deviceDiscoveryTopic.Name,
Timestamp: time.Now().UnixNano(),
}
@@ -225,14 +241,14 @@
}
// InvokeRPC is used to send a request to a given topic
-func (kp *InterContainerProxy) InvokeRPC(ctx context.Context, rpc string, toTopic *Topic, replyToTopic *Topic,
+func (kp *interContainerProxy) InvokeRPC(ctx context.Context, rpc string, toTopic *Topic, replyToTopic *Topic,
waitForResponse bool, key string, kvArgs ...*KVArg) (bool, *any.Any) {
// If a replyToTopic is provided then we use it, otherwise just use the default toTopic. The replyToTopic is
// typically the device ID.
responseTopic := replyToTopic
if responseTopic == nil {
- responseTopic = kp.DefaultTopic
+ responseTopic = kp.defaultTopic
}
// Encode the request
@@ -288,12 +304,14 @@
var err error
if responseBody, err = decodeResponse(msg); err != nil {
logger.Errorw("decode-response-error", log.Fields{"error": err})
+ // FIXME we should return something
}
return responseBody.Success, responseBody.Result
case <-ctx.Done():
logger.Debugw("context-cancelled", log.Fields{"rpc": rpc, "ctx": ctx.Err()})
// pack the error as proto any type
- protoError := &ic.Error{Reason: ctx.Err().Error()}
+ protoError := &ic.Error{Reason: ctx.Err().Error(), Code: ic.ErrorCode_DEADLINE_EXCEEDED}
+
var marshalledArg *any.Any
if marshalledArg, err = ptypes.MarshalAny(protoError); err != nil {
return false, nil // Should never happen
@@ -302,7 +320,8 @@
case <-childCtx.Done():
logger.Debugw("context-cancelled", log.Fields{"rpc": rpc, "ctx": childCtx.Err()})
// pack the error as proto any type
- protoError := &ic.Error{Reason: childCtx.Err().Error()}
+ protoError := &ic.Error{Reason: childCtx.Err().Error(), Code: ic.ErrorCode_DEADLINE_EXCEEDED}
+
var marshalledArg *any.Any
if marshalledArg, err = ptypes.MarshalAny(protoError); err != nil {
return false, nil // Should never happen
@@ -318,7 +337,7 @@
// SubscribeWithRequestHandlerInterface allows a caller to assign a target object to be invoked automatically
// when a message is received on a given topic
-func (kp *InterContainerProxy) SubscribeWithRequestHandlerInterface(topic Topic, handler interface{}) error {
+func (kp *interContainerProxy) SubscribeWithRequestHandlerInterface(topic Topic, handler interface{}) error {
// Subscribe to receive messages for that topic
var ch <-chan *ic.InterContainerMessage
@@ -339,7 +358,7 @@
// SubscribeWithDefaultRequestHandler allows a caller to add a topic to an existing target object to be invoked automatically
// when a message is received on a given topic. So far there is only 1 target registered per microservice
-func (kp *InterContainerProxy) SubscribeWithDefaultRequestHandler(topic Topic, initialOffset int64) error {
+func (kp *interContainerProxy) SubscribeWithDefaultRequestHandler(topic Topic, initialOffset int64) error {
// Subscribe to receive messages for that topic
var ch <-chan *ic.InterContainerMessage
var err error
@@ -355,13 +374,13 @@
return nil
}
-func (kp *InterContainerProxy) UnSubscribeFromRequestHandler(topic Topic) error {
+func (kp *interContainerProxy) UnSubscribeFromRequestHandler(topic Topic) error {
return kp.deleteFromTopicRequestHandlerChannelMap(topic.Name)
}
// setupTopicResponseChannelMap sets up single consumers channel that will act as a broadcast channel for all
// responses from that topic.
-func (kp *InterContainerProxy) setupTopicResponseChannelMap(topic string, arg <-chan *ic.InterContainerMessage) {
+func (kp *interContainerProxy) setupTopicResponseChannelMap(topic string, arg <-chan *ic.InterContainerMessage) {
kp.lockTopicResponseChannelMap.Lock()
defer kp.lockTopicResponseChannelMap.Unlock()
if _, exist := kp.topicToResponseChannelMap[topic]; !exist {
@@ -369,14 +388,14 @@
}
}
-func (kp *InterContainerProxy) isTopicSubscribedForResponse(topic string) bool {
+func (kp *interContainerProxy) isTopicSubscribedForResponse(topic string) bool {
kp.lockTopicResponseChannelMap.RLock()
defer kp.lockTopicResponseChannelMap.RUnlock()
_, exist := kp.topicToResponseChannelMap[topic]
return exist
}
-func (kp *InterContainerProxy) deleteFromTopicResponseChannelMap(topic string) error {
+func (kp *interContainerProxy) deleteFromTopicResponseChannelMap(topic string) error {
kp.lockTopicResponseChannelMap.Lock()
defer kp.lockTopicResponseChannelMap.Unlock()
if _, exist := kp.topicToResponseChannelMap[topic]; exist {
@@ -392,7 +411,7 @@
}
}
-func (kp *InterContainerProxy) deleteAllTopicResponseChannelMap() error {
+func (kp *interContainerProxy) deleteAllTopicResponseChannelMap() error {
kp.lockTopicResponseChannelMap.Lock()
defer kp.lockTopicResponseChannelMap.Unlock()
var err error
@@ -406,7 +425,7 @@
return err
}
-func (kp *InterContainerProxy) addToTopicRequestHandlerChannelMap(topic string, arg *requestHandlerChannel) {
+func (kp *interContainerProxy) addToTopicRequestHandlerChannelMap(topic string, arg *requestHandlerChannel) {
kp.lockTopicRequestHandlerChannelMap.Lock()
defer kp.lockTopicRequestHandlerChannelMap.Unlock()
if _, exist := kp.topicToRequestHandlerChannelMap[topic]; !exist {
@@ -414,7 +433,7 @@
}
}
-func (kp *InterContainerProxy) deleteFromTopicRequestHandlerChannelMap(topic string) error {
+func (kp *interContainerProxy) deleteFromTopicRequestHandlerChannelMap(topic string) error {
kp.lockTopicRequestHandlerChannelMap.Lock()
defer kp.lockTopicRequestHandlerChannelMap.Unlock()
if _, exist := kp.topicToRequestHandlerChannelMap[topic]; exist {
@@ -427,7 +446,7 @@
}
}
-func (kp *InterContainerProxy) deleteAllTopicRequestHandlerChannelMap() error {
+func (kp *interContainerProxy) deleteAllTopicRequestHandlerChannelMap() error {
kp.lockTopicRequestHandlerChannelMap.Lock()
defer kp.lockTopicRequestHandlerChannelMap.Unlock()
var err error
@@ -441,7 +460,7 @@
return err
}
-func (kp *InterContainerProxy) addToTransactionIdToChannelMap(id string, topic *Topic, arg chan *ic.InterContainerMessage) {
+func (kp *interContainerProxy) addToTransactionIdToChannelMap(id string, topic *Topic, arg chan *ic.InterContainerMessage) {
kp.lockTransactionIdToChannelMap.Lock()
defer kp.lockTransactionIdToChannelMap.Unlock()
if _, exist := kp.transactionIdToChannelMap[id]; !exist {
@@ -449,7 +468,7 @@
}
}
-func (kp *InterContainerProxy) deleteFromTransactionIdToChannelMap(id string) {
+func (kp *interContainerProxy) deleteFromTransactionIdToChannelMap(id string) {
kp.lockTransactionIdToChannelMap.Lock()
defer kp.lockTransactionIdToChannelMap.Unlock()
if transChannel, exist := kp.transactionIdToChannelMap[id]; exist {
@@ -459,7 +478,7 @@
}
}
-func (kp *InterContainerProxy) deleteTopicTransactionIdToChannelMap(id string) {
+func (kp *interContainerProxy) deleteTopicTransactionIdToChannelMap(id string) {
kp.lockTransactionIdToChannelMap.Lock()
defer kp.lockTransactionIdToChannelMap.Unlock()
for key, value := range kp.transactionIdToChannelMap {
@@ -470,7 +489,7 @@
}
}
-func (kp *InterContainerProxy) deleteAllTransactionIdToChannelMap() {
+func (kp *interContainerProxy) deleteAllTransactionIdToChannelMap() {
kp.lockTransactionIdToChannelMap.Lock()
defer kp.lockTransactionIdToChannelMap.Unlock()
for key, value := range kp.transactionIdToChannelMap {
@@ -479,7 +498,7 @@
}
}
-func (kp *InterContainerProxy) DeleteTopic(topic Topic) error {
+func (kp *interContainerProxy) DeleteTopic(topic Topic) error {
// If we have any consumers on that topic we need to close them
if err := kp.deleteFromTopicResponseChannelMap(topic.Name); err != nil {
logger.Errorw("delete-from-topic-responsechannelmap-failed", log.Fields{"error": err})
@@ -520,7 +539,7 @@
Type: ic.MessageType_RESPONSE,
FromTopic: request.Header.ToTopic,
ToTopic: request.Header.FromTopic,
- Timestamp: time.Now().Unix(),
+ Timestamp: time.Now().UnixNano(),
}
responseBody := &ic.InterContainerResponseBody{
Success: false,
@@ -598,7 +617,7 @@
return
}
-func (kp *InterContainerProxy) addTransactionId(transactionId string, currentArgs []*ic.Argument) []*ic.Argument {
+func (kp *interContainerProxy) addTransactionId(transactionId string, currentArgs []*ic.Argument) []*ic.Argument {
arg := &KVArg{
Key: TransactionKey,
Value: &ic.StrType{Val: transactionId},
@@ -617,7 +636,7 @@
return append(currentArgs, protoArg)
}
-func (kp *InterContainerProxy) addFromTopic(fromTopic string, currentArgs []*ic.Argument) []*ic.Argument {
+func (kp *interContainerProxy) addFromTopic(fromTopic string, currentArgs []*ic.Argument) []*ic.Argument {
var marshalledArg *any.Any
var err error
if marshalledArg, err = ptypes.MarshalAny(&ic.StrType{Val: fromTopic}); err != nil {
@@ -631,7 +650,7 @@
return append(currentArgs, protoArg)
}
-func (kp *InterContainerProxy) handleMessage(msg *ic.InterContainerMessage, targetInterface interface{}) {
+func (kp *interContainerProxy) handleMessage(msg *ic.InterContainerMessage, targetInterface interface{}) {
// First extract the header to know whether this is a request - responses are handled by a different handler
if msg.Header.Type == ic.MessageType_REQUEST {
@@ -721,7 +740,7 @@
}
}
-func (kp *InterContainerProxy) waitForMessages(ch <-chan *ic.InterContainerMessage, topic Topic, targetInterface interface{}) {
+func (kp *interContainerProxy) waitForMessages(ch <-chan *ic.InterContainerMessage, topic Topic, targetInterface interface{}) {
// Wait for messages
for msg := range ch {
//logger.Debugw("request-received", log.Fields{"msg": msg, "topic": topic.Name, "target": targetInterface})
@@ -729,7 +748,7 @@
}
}
-func (kp *InterContainerProxy) dispatchResponse(msg *ic.InterContainerMessage) {
+func (kp *interContainerProxy) dispatchResponse(msg *ic.InterContainerMessage) {
kp.lockTransactionIdToChannelMap.RLock()
defer kp.lockTransactionIdToChannelMap.RUnlock()
if _, exist := kp.transactionIdToChannelMap[msg.Header.Id]; !exist {
@@ -743,7 +762,7 @@
// This method is built to prevent all subscribers to receive all messages as is the case of the Subscribe
// API. There is one response channel waiting for kafka messages before dispatching the message to the
// corresponding waiting channel
-func (kp *InterContainerProxy) subscribeForResponse(topic Topic, trnsId string) (chan *ic.InterContainerMessage, error) {
+func (kp *interContainerProxy) subscribeForResponse(topic Topic, trnsId string) (chan *ic.InterContainerMessage, error) {
logger.Debugw("subscribeForResponse", log.Fields{"topic": topic.Name, "trnsid": trnsId})
// Create a specific channel for this consumers. We cannot use the channel from the kafkaclient as it will
@@ -754,21 +773,21 @@
return ch, nil
}
-func (kp *InterContainerProxy) unSubscribeForResponse(trnsId string) error {
+func (kp *interContainerProxy) unSubscribeForResponse(trnsId string) error {
logger.Debugw("unsubscribe-for-response", log.Fields{"trnsId": trnsId})
kp.deleteFromTransactionIdToChannelMap(trnsId)
return nil
}
-func (kp *InterContainerProxy) EnableLivenessChannel(enable bool) chan bool {
+func (kp *interContainerProxy) EnableLivenessChannel(enable bool) chan bool {
return kp.kafkaClient.EnableLivenessChannel(enable)
}
-func (kp *InterContainerProxy) EnableHealthinessChannel(enable bool) chan bool {
+func (kp *interContainerProxy) EnableHealthinessChannel(enable bool) chan bool {
return kp.kafkaClient.EnableHealthinessChannel(enable)
}
-func (kp *InterContainerProxy) SendLiveness() error {
+func (kp *interContainerProxy) SendLiveness() error {
return kp.kafkaClient.SendLiveness()
}
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/sarama_client.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/sarama_client.go
index 9d4ab52..c0c16f9 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/sarama_client.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/kafka/sarama_client.go
@@ -42,6 +42,9 @@
channels []chan *ic.InterContainerMessage
}
+// static check to ensure SaramaClient implements Client
+var _ Client = &SaramaClient{}
+
// SaramaClient represents the messaging proxy
type SaramaClient struct {
cAdmin sarama.ClusterAdmin
@@ -68,6 +71,7 @@
numReplicas int
autoCreateTopic bool
doneCh chan int
+ metadataCallback func(fromTopic string, timestamp int64)
topicToConsumerChannelMap map[string]*consumerChannels
lockTopicToConsumerChannelMap sync.RWMutex
topicLockMap map[string]*sync.RWMutex
@@ -460,6 +464,10 @@
return err
}
+func (sc *SaramaClient) SubscribeForMetadata(callback func(fromTopic string, timestamp int64)) {
+ sc.metadataCallback = callback
+}
+
func (sc *SaramaClient) updateLiveness(alive bool) {
// Post a consistent stream of liveness data to the channel,
// so that in a live state, the core does not timeout and
@@ -930,12 +938,16 @@
func (sc *SaramaClient) dispatchToConsumers(consumerCh *consumerChannels, protoMessage *ic.InterContainerMessage) {
// Need to go over all channels and publish messages to them - do we need to copy msg?
sc.lockTopicToConsumerChannelMap.RLock()
- defer sc.lockTopicToConsumerChannelMap.RUnlock()
for _, ch := range consumerCh.channels {
go func(c chan *ic.InterContainerMessage) {
c <- protoMessage
}(ch)
}
+ sc.lockTopicToConsumerChannelMap.RUnlock()
+
+ if callback := sc.metadataCallback; callback != nil {
+ callback(protoMessage.Header.FromTopic, protoMessage.Header.Timestamp)
+ }
}
func (sc *SaramaClient) consumeFromAPartition(topic *Topic, consumer sarama.PartitionConsumer, consumerChnls *consumerChannels) {
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/ponresourcemanager/ponresourcemanager.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/ponresourcemanager/ponresourcemanager.go
index 4587675..ad2150a 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/ponresourcemanager/ponresourcemanager.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/ponresourcemanager/ponresourcemanager.go
@@ -17,6 +17,7 @@
package ponresourcemanager
import (
+ "context"
"encoding/base64"
"encoding/json"
"errors"
@@ -209,7 +210,7 @@
OLT model key, if available
*/
-func (PONRMgr *PONResourceManager) InitResourceRangesFromKVStore() bool {
+func (PONRMgr *PONResourceManager) InitResourceRangesFromKVStore(ctx context.Context) bool {
//Initialize PON resource ranges with config fetched from kv store.
//:return boolean: True if PON resource ranges initialized else false
// Try to initialize the PON Resource Ranges from KV store based on the
@@ -220,7 +221,7 @@
}
Path := fmt.Sprintf(PON_RESOURCE_RANGE_CONFIG_PATH, PONRMgr.OLTModel)
//get resource from kv store
- Result, err := PONRMgr.KVStore.Get(Path)
+ Result, err := PONRMgr.KVStore.Get(ctx, Path)
if err != nil {
log.Debugf("Error in fetching resource %s from KV strore", Path)
return false
@@ -327,7 +328,7 @@
return true
}
-func (PONRMgr *PONResourceManager) InitDeviceResourcePool() error {
+func (PONRMgr *PONResourceManager) InitDeviceResourcePool(ctx context.Context) error {
//Initialize resource pool for all PON ports.
@@ -339,7 +340,7 @@
if SharedPoolID != 0 {
Intf = SharedPoolID
}
- if err = PONRMgr.InitResourceIDPool(Intf, ONU_ID,
+ if err = PONRMgr.InitResourceIDPool(ctx, Intf, ONU_ID,
PONRMgr.PonResourceRanges[ONU_ID_START_IDX].(uint32),
PONRMgr.PonResourceRanges[ONU_ID_END_IDX].(uint32)); err != nil {
log.Error("Failed to init ONU ID resource pool")
@@ -355,7 +356,7 @@
if SharedPoolID != 0 {
Intf = SharedPoolID
}
- if err = PONRMgr.InitResourceIDPool(Intf, ALLOC_ID,
+ if err = PONRMgr.InitResourceIDPool(ctx, Intf, ALLOC_ID,
PONRMgr.PonResourceRanges[ALLOC_ID_START_IDX].(uint32),
PONRMgr.PonResourceRanges[ALLOC_ID_END_IDX].(uint32)); err != nil {
log.Error("Failed to init ALLOC ID resource pool ")
@@ -370,7 +371,7 @@
if SharedPoolID != 0 {
Intf = SharedPoolID
}
- if err = PONRMgr.InitResourceIDPool(Intf, GEMPORT_ID,
+ if err = PONRMgr.InitResourceIDPool(ctx, Intf, GEMPORT_ID,
PONRMgr.PonResourceRanges[GEMPORT_ID_START_IDX].(uint32),
PONRMgr.PonResourceRanges[GEMPORT_ID_END_IDX].(uint32)); err != nil {
log.Error("Failed to init GEMPORT ID resource pool")
@@ -386,7 +387,7 @@
if SharedPoolID != 0 {
Intf = SharedPoolID
}
- if err = PONRMgr.InitResourceIDPool(Intf, FLOW_ID,
+ if err = PONRMgr.InitResourceIDPool(ctx, Intf, FLOW_ID,
PONRMgr.PonResourceRanges[FLOW_ID_START_IDX].(uint32),
PONRMgr.PonResourceRanges[FLOW_ID_END_IDX].(uint32)); err != nil {
log.Error("Failed to init FLOW ID resource pool")
@@ -399,7 +400,7 @@
return err
}
-func (PONRMgr *PONResourceManager) ClearDeviceResourcePool() error {
+func (PONRMgr *PONResourceManager) ClearDeviceResourcePool(ctx context.Context) error {
//Clear resource pool for all PON ports.
@@ -410,7 +411,7 @@
if SharedPoolID != 0 {
Intf = SharedPoolID
}
- if status := PONRMgr.ClearResourceIDPool(Intf, ONU_ID); status != true {
+ if status := PONRMgr.ClearResourceIDPool(ctx, Intf, ONU_ID); status != true {
log.Error("Failed to clear ONU ID resource pool")
return errors.New("Failed to clear ONU ID resource pool")
}
@@ -424,7 +425,7 @@
if SharedPoolID != 0 {
Intf = SharedPoolID
}
- if status := PONRMgr.ClearResourceIDPool(Intf, ALLOC_ID); status != true {
+ if status := PONRMgr.ClearResourceIDPool(ctx, Intf, ALLOC_ID); status != true {
log.Error("Failed to clear ALLOC ID resource pool ")
return errors.New("Failed to clear ALLOC ID resource pool")
}
@@ -437,7 +438,7 @@
if SharedPoolID != 0 {
Intf = SharedPoolID
}
- if status := PONRMgr.ClearResourceIDPool(Intf, GEMPORT_ID); status != true {
+ if status := PONRMgr.ClearResourceIDPool(ctx, Intf, GEMPORT_ID); status != true {
log.Error("Failed to clear GEMPORT ID resource pool")
return errors.New("Failed to clear GEMPORT ID resource pool")
}
@@ -451,7 +452,7 @@
if SharedPoolID != 0 {
Intf = SharedPoolID
}
- if status := PONRMgr.ClearResourceIDPool(Intf, FLOW_ID); status != true {
+ if status := PONRMgr.ClearResourceIDPool(ctx, Intf, FLOW_ID); status != true {
log.Error("Failed to clear FLOW ID resource pool")
return errors.New("Failed to clear FLOW ID resource pool")
}
@@ -462,7 +463,7 @@
return nil
}
-func (PONRMgr *PONResourceManager) InitResourceIDPool(Intf uint32, ResourceType string, StartID uint32, EndID uint32) error {
+func (PONRMgr *PONResourceManager) InitResourceIDPool(ctx context.Context, Intf uint32, ResourceType string, StartID uint32, EndID uint32) error {
/*Initialize Resource ID pool for a given Resource Type on a given PON Port
@@ -476,7 +477,7 @@
// delegate to the master instance if sharing enabled across instances
SharedResourceMgr := PONRMgr.SharedResourceMgrs[PONRMgr.SharedIdxByType[ResourceType]]
if SharedResourceMgr != nil && PONRMgr != SharedResourceMgr {
- return SharedResourceMgr.InitResourceIDPool(Intf, ResourceType, StartID, EndID)
+ return SharedResourceMgr.InitResourceIDPool(ctx, Intf, ResourceType, StartID, EndID)
}
Path := PONRMgr.GetPath(Intf, ResourceType)
@@ -487,7 +488,7 @@
//In case of adapter reboot and reconciliation resource in kv store
//checked for its presence if not kv store update happens
- Res, err := PONRMgr.GetResource(Path)
+ Res, err := PONRMgr.GetResource(ctx, Path)
if (err == nil) && (Res != nil) {
log.Debugf("Resource %s already present in store ", Path)
return nil
@@ -498,7 +499,7 @@
return err
}
// Add resource as json in kv store.
- err = PONRMgr.KVStore.Put(Path, FormatResult)
+ err = PONRMgr.KVStore.Put(ctx, Path, FormatResult)
if err == nil {
log.Debug("Successfuly posted to kv store")
return err
@@ -542,7 +543,7 @@
}
return Value, err
}
-func (PONRMgr *PONResourceManager) GetResource(Path string) (map[string]interface{}, error) {
+func (PONRMgr *PONResourceManager) GetResource(ctx context.Context, Path string) (map[string]interface{}, error) {
/*
Get resource from kv store.
@@ -555,7 +556,7 @@
Result := make(map[string]interface{})
var Str string
- Resource, err := PONRMgr.KVStore.Get(Path)
+ Resource, err := PONRMgr.KVStore.Get(ctx, Path)
if (err != nil) || (Resource == nil) {
log.Debugf("Resource unavailable at %s", Path)
return nil, err
@@ -620,7 +621,7 @@
return Path
}
-func (PONRMgr *PONResourceManager) GetResourceID(IntfID uint32, ResourceType string, NumIDs uint32) ([]uint32, error) {
+func (PONRMgr *PONResourceManager) GetResourceID(ctx context.Context, IntfID uint32, ResourceType string, NumIDs uint32) ([]uint32, error) {
/*
Create alloc/gemport/onu/flow id for given OLT PON interface.
:param pon_intf_id: OLT PON interface id
@@ -637,7 +638,7 @@
SharedResourceMgr := PONRMgr.SharedResourceMgrs[PONRMgr.SharedIdxByType[ResourceType]]
if SharedResourceMgr != nil && PONRMgr != SharedResourceMgr {
- return SharedResourceMgr.GetResourceID(IntfID, ResourceType, NumIDs)
+ return SharedResourceMgr.GetResourceID(ctx, IntfID, ResourceType, NumIDs)
}
log.Debugf("Fetching resource from %s rsrc mgr for resource %s", PONRMgr.Globalorlocal, ResourceType)
@@ -649,7 +650,7 @@
log.Debugf("Get resource for type %s on path %s", ResourceType, Path)
var Result []uint32
var NextID uint32
- Resource, err := PONRMgr.GetResource(Path)
+ Resource, err := PONRMgr.GetResource(ctx, Path)
if (err == nil) && (ResourceType == ONU_ID) || (ResourceType == FLOW_ID) {
if NextID, err = PONRMgr.GenerateNextID(Resource); err != nil {
log.Error("Failed to Generate ID")
@@ -679,7 +680,7 @@
}
//Update resource in kv store
- if PONRMgr.UpdateResource(Path, Resource) != nil {
+ if PONRMgr.UpdateResource(ctx, Path, Resource) != nil {
log.Errorf("Failed to update resource %s", Path)
return nil, errors.New(fmt.Sprintf("Failed to update resource %s", Path))
}
@@ -697,7 +698,7 @@
return false
}
-func (PONRMgr *PONResourceManager) FreeResourceID(IntfID uint32, ResourceType string, ReleaseContent []uint32) bool {
+func (PONRMgr *PONResourceManager) FreeResourceID(ctx context.Context, IntfID uint32, ResourceType string, ReleaseContent []uint32) bool {
/*
Release alloc/gemport/onu/flow id for given OLT PON interface.
:param pon_intf_id: OLT PON interface id
@@ -716,14 +717,14 @@
// delegate to the master instance if sharing enabled across instances
SharedResourceMgr := PONRMgr.SharedResourceMgrs[PONRMgr.SharedIdxByType[ResourceType]]
if SharedResourceMgr != nil && PONRMgr != SharedResourceMgr {
- return SharedResourceMgr.FreeResourceID(IntfID, ResourceType, ReleaseContent)
+ return SharedResourceMgr.FreeResourceID(ctx, IntfID, ResourceType, ReleaseContent)
}
Path := PONRMgr.GetPath(IntfID, ResourceType)
if Path == "" {
log.Error("Failed to get path")
return false
}
- Resource, err := PONRMgr.GetResource(Path)
+ Resource, err := PONRMgr.GetResource(ctx, Path)
if err != nil {
log.Error("Failed to get resource")
return false
@@ -731,14 +732,14 @@
for _, Val := range ReleaseContent {
PONRMgr.ReleaseID(Resource, Val)
}
- if PONRMgr.UpdateResource(Path, Resource) != nil {
+ if PONRMgr.UpdateResource(ctx, Path, Resource) != nil {
log.Errorf("Free resource for %s failed", Path)
return false
}
return true
}
-func (PONRMgr *PONResourceManager) UpdateResource(Path string, Resource map[string]interface{}) error {
+func (PONRMgr *PONResourceManager) UpdateResource(ctx context.Context, Path string, Resource map[string]interface{}) error {
/*
Update resource in resource kv store.
:param path: path to update resource
@@ -751,7 +752,7 @@
log.Error("failed to Marshal")
return err
}
- err = PONRMgr.KVStore.Put(Path, Value)
+ err = PONRMgr.KVStore.Put(ctx, Path, Value)
if err != nil {
log.Error("failed to put data to kv store %s", Path)
return err
@@ -759,7 +760,7 @@
return nil
}
-func (PONRMgr *PONResourceManager) ClearResourceIDPool(IntfID uint32, ResourceType string) bool {
+func (PONRMgr *PONResourceManager) ClearResourceIDPool(ctx context.Context, contIntfID uint32, ResourceType string) bool {
/*
Clear Resource Pool for a given Resource Type on a given PON Port.
:return boolean: True if removed else False
@@ -768,15 +769,15 @@
// delegate to the master instance if sharing enabled across instances
SharedResourceMgr := PONRMgr.SharedResourceMgrs[PONRMgr.SharedIdxByType[ResourceType]]
if SharedResourceMgr != nil && PONRMgr != SharedResourceMgr {
- return SharedResourceMgr.ClearResourceIDPool(IntfID, ResourceType)
+ return SharedResourceMgr.ClearResourceIDPool(ctx, contIntfID, ResourceType)
}
- Path := PONRMgr.GetPath(IntfID, ResourceType)
+ Path := PONRMgr.GetPath(contIntfID, ResourceType)
if Path == "" {
log.Error("Failed to get path")
return false
}
- if err := PONRMgr.KVStore.Delete(Path); err != nil {
+ if err := PONRMgr.KVStore.Delete(ctx, Path); err != nil {
log.Errorf("Failed to delete resource %s", Path)
return false
}
@@ -784,7 +785,7 @@
return true
}
-func (PONRMgr PONResourceManager) InitResourceMap(PONIntfONUID string) {
+func (PONRMgr PONResourceManager) InitResourceMap(ctx context.Context, PONIntfONUID string) {
/*
Initialize resource map
:param pon_intf_onu_id: reference of PON interface id and onu id
@@ -792,7 +793,7 @@
// initialize pon_intf_onu_id tuple to alloc_ids map
AllocIDPath := fmt.Sprintf(ALLOC_ID_RESOURCE_MAP_PATH, PONRMgr.DeviceID, PONIntfONUID)
var AllocIDs []byte
- Result := PONRMgr.KVStore.Put(AllocIDPath, AllocIDs)
+ Result := PONRMgr.KVStore.Put(ctx, AllocIDPath, AllocIDs)
if Result != nil {
log.Error("Failed to update the KV store")
return
@@ -800,14 +801,14 @@
// initialize pon_intf_onu_id tuple to gemport_ids map
GEMPortIDPath := fmt.Sprintf(GEMPORT_ID_RESOURCE_MAP_PATH, PONRMgr.DeviceID, PONIntfONUID)
var GEMPortIDs []byte
- Result = PONRMgr.KVStore.Put(GEMPortIDPath, GEMPortIDs)
+ Result = PONRMgr.KVStore.Put(ctx, GEMPortIDPath, GEMPortIDs)
if Result != nil {
log.Error("Failed to update the KV store")
return
}
}
-func (PONRMgr PONResourceManager) RemoveResourceMap(PONIntfONUID string) bool {
+func (PONRMgr PONResourceManager) RemoveResourceMap(ctx context.Context, PONIntfONUID string) bool {
/*
Remove resource map
:param pon_intf_onu_id: reference of PON interface id and onu id
@@ -815,30 +816,30 @@
// remove pon_intf_onu_id tuple to alloc_ids map
var err error
AllocIDPath := fmt.Sprintf(ALLOC_ID_RESOURCE_MAP_PATH, PONRMgr.DeviceID, PONIntfONUID)
- if err = PONRMgr.KVStore.Delete(AllocIDPath); err != nil {
+ if err = PONRMgr.KVStore.Delete(ctx, AllocIDPath); err != nil {
log.Errorf("Failed to remove resource %s", AllocIDPath)
return false
}
// remove pon_intf_onu_id tuple to gemport_ids map
GEMPortIDPath := fmt.Sprintf(GEMPORT_ID_RESOURCE_MAP_PATH, PONRMgr.DeviceID, PONIntfONUID)
- err = PONRMgr.KVStore.Delete(GEMPortIDPath)
+ err = PONRMgr.KVStore.Delete(ctx, GEMPortIDPath)
if err != nil {
log.Errorf("Failed to remove resource %s", GEMPortIDPath)
return false
}
FlowIDPath := fmt.Sprintf(FLOW_ID_RESOURCE_MAP_PATH, PONRMgr.DeviceID, PONIntfONUID)
- if FlowIDs, err := PONRMgr.KVStore.List(FlowIDPath); err != nil {
+ if FlowIDs, err := PONRMgr.KVStore.List(ctx, FlowIDPath); err != nil {
for _, Flow := range FlowIDs {
FlowIDInfoPath := fmt.Sprintf(FLOW_ID_INFO_PATH, PONRMgr.DeviceID, PONIntfONUID, Flow.Value)
- if err = PONRMgr.KVStore.Delete(FlowIDInfoPath); err != nil {
+ if err = PONRMgr.KVStore.Delete(ctx, FlowIDInfoPath); err != nil {
log.Errorf("Failed to remove resource %s", FlowIDInfoPath)
return false
}
}
}
- if err = PONRMgr.KVStore.Delete(FlowIDPath); err != nil {
+ if err = PONRMgr.KVStore.Delete(ctx, FlowIDPath); err != nil {
log.Errorf("Failed to remove resource %s", FlowIDPath)
return false
}
@@ -846,7 +847,7 @@
return true
}
-func (PONRMgr *PONResourceManager) GetCurrentAllocIDForOnu(IntfONUID string) []uint32 {
+func (PONRMgr *PONResourceManager) GetCurrentAllocIDForOnu(ctx context.Context, IntfONUID string) []uint32 {
/*
Get currently configured alloc ids for given pon_intf_onu_id
:param pon_intf_onu_id: reference of PON interface id and onu id
@@ -855,7 +856,7 @@
Path := fmt.Sprintf(ALLOC_ID_RESOURCE_MAP_PATH, PONRMgr.DeviceID, IntfONUID)
var Data []uint32
- Value, err := PONRMgr.KVStore.Get(Path)
+ Value, err := PONRMgr.KVStore.Get(ctx, Path)
if err == nil {
if Value != nil {
Val, err := ToByte(Value.Value)
@@ -872,7 +873,7 @@
return Data
}
-func (PONRMgr *PONResourceManager) GetCurrentGEMPortIDsForOnu(IntfONUID string) []uint32 {
+func (PONRMgr *PONResourceManager) GetCurrentGEMPortIDsForOnu(ctx context.Context, IntfONUID string) []uint32 {
/*
Get currently configured gemport ids for given pon_intf_onu_id
:param pon_intf_onu_id: reference of PON interface id and onu id
@@ -882,7 +883,7 @@
Path := fmt.Sprintf(GEMPORT_ID_RESOURCE_MAP_PATH, PONRMgr.DeviceID, IntfONUID)
log.Debugf("Getting current gemports for %s", Path)
var Data []uint32
- Value, err := PONRMgr.KVStore.Get(Path)
+ Value, err := PONRMgr.KVStore.Get(ctx, Path)
if err == nil {
if Value != nil {
Val, _ := ToByte(Value.Value)
@@ -897,7 +898,7 @@
return Data
}
-func (PONRMgr *PONResourceManager) GetCurrentFlowIDsForOnu(IntfONUID string) []uint32 {
+func (PONRMgr *PONResourceManager) GetCurrentFlowIDsForOnu(ctx context.Context, IntfONUID string) []uint32 {
/*
Get currently configured flow ids for given pon_intf_onu_id
:param pon_intf_onu_id: reference of PON interface id and onu id
@@ -907,7 +908,7 @@
Path := fmt.Sprintf(FLOW_ID_RESOURCE_MAP_PATH, PONRMgr.DeviceID, IntfONUID)
var Data []uint32
- Value, err := PONRMgr.KVStore.Get(Path)
+ Value, err := PONRMgr.KVStore.Get(ctx, Path)
if err == nil {
if Value != nil {
Val, _ := ToByte(Value.Value)
@@ -920,7 +921,7 @@
return Data
}
-func (PONRMgr *PONResourceManager) GetFlowIDInfo(IntfONUID string, FlowID uint32, Data interface{}) error {
+func (PONRMgr *PONResourceManager) GetFlowIDInfo(ctx context.Context, IntfONUID string, FlowID uint32, Data interface{}) error {
/*
Get flow details configured for the ONU.
:param pon_intf_onu_id: reference of PON interface id and onu id
@@ -931,7 +932,7 @@
Path := fmt.Sprintf(FLOW_ID_INFO_PATH, PONRMgr.DeviceID, IntfONUID, FlowID)
- Value, err := PONRMgr.KVStore.Get(Path)
+ Value, err := PONRMgr.KVStore.Get(ctx, Path)
if err == nil {
if Value != nil {
Val, err := ToByte(Value.Value)
@@ -948,7 +949,7 @@
return err
}
-func (PONRMgr *PONResourceManager) RemoveFlowIDInfo(IntfONUID string, FlowID uint32) bool {
+func (PONRMgr *PONResourceManager) RemoveFlowIDInfo(ctx context.Context, IntfONUID string, FlowID uint32) bool {
/*
Get flow_id details configured for the ONU.
:param pon_intf_onu_id: reference of PON interface id and onu id
@@ -956,14 +957,14 @@
*/
Path := fmt.Sprintf(FLOW_ID_INFO_PATH, PONRMgr.DeviceID, IntfONUID, FlowID)
- if err := PONRMgr.KVStore.Delete(Path); err != nil {
+ if err := PONRMgr.KVStore.Delete(ctx, Path); err != nil {
log.Errorf("Falied to remove resource %s", Path)
return false
}
return true
}
-func (PONRMgr *PONResourceManager) UpdateAllocIdsForOnu(IntfONUID string, AllocIDs []uint32) error {
+func (PONRMgr *PONResourceManager) UpdateAllocIdsForOnu(ctx context.Context, IntfONUID string, AllocIDs []uint32) error {
/*
Update currently configured alloc ids for given pon_intf_onu_id
:param pon_intf_onu_id: reference of PON interface id and onu id
@@ -978,14 +979,14 @@
return err
}
- if err = PONRMgr.KVStore.Put(Path, Value); err != nil {
+ if err = PONRMgr.KVStore.Put(ctx, Path, Value); err != nil {
log.Errorf("Failed to update resource %s", Path)
return err
}
return err
}
-func (PONRMgr *PONResourceManager) UpdateGEMPortIDsForOnu(IntfONUID string, GEMPortIDs []uint32) error {
+func (PONRMgr *PONResourceManager) UpdateGEMPortIDsForOnu(ctx context.Context, IntfONUID string, GEMPortIDs []uint32) error {
/*
Update currently configured gemport ids for given pon_intf_onu_id
:param pon_intf_onu_id: reference of PON interface id and onu id
@@ -1002,7 +1003,7 @@
return err
}
- if err = PONRMgr.KVStore.Put(Path, Value); err != nil {
+ if err = PONRMgr.KVStore.Put(ctx, Path, Value); err != nil {
log.Errorf("Failed to update resource %s", Path)
return err
}
@@ -1025,7 +1026,7 @@
return false, 0
}
-func (PONRMgr *PONResourceManager) UpdateFlowIDForOnu(IntfONUID string, FlowID uint32, Add bool) error {
+func (PONRMgr *PONResourceManager) UpdateFlowIDForOnu(ctx context.Context, IntfONUID string, FlowID uint32, Add bool) error {
/*
Update the flow_id list of the ONU (add or remove flow_id from the list)
:param pon_intf_onu_id: reference of PON interface id and onu id
@@ -1038,7 +1039,7 @@
var RetVal bool
var IDx uint32
Path := fmt.Sprintf(FLOW_ID_RESOURCE_MAP_PATH, PONRMgr.DeviceID, IntfONUID)
- FlowIDs := PONRMgr.GetCurrentFlowIDsForOnu(IntfONUID)
+ FlowIDs := PONRMgr.GetCurrentFlowIDsForOnu(ctx, IntfONUID)
if Add {
if RetVal, IDx = checkForFlowIDInList(FlowIDs, FlowID); RetVal == true {
@@ -1058,14 +1059,14 @@
return err
}
- if err = PONRMgr.KVStore.Put(Path, Value); err != nil {
+ if err = PONRMgr.KVStore.Put(ctx, Path, Value); err != nil {
log.Errorf("Failed to update resource %s", Path)
return err
}
return err
}
-func (PONRMgr *PONResourceManager) UpdateFlowIDInfoForOnu(IntfONUID string, FlowID uint32, FlowData interface{}) error {
+func (PONRMgr *PONResourceManager) UpdateFlowIDInfoForOnu(ctx context.Context, IntfONUID string, FlowID uint32, FlowData interface{}) error {
/*
Update any metadata associated with the flow_id. The flow_data could be json
or any of other data structure. The resource manager doesnt care
@@ -1082,7 +1083,7 @@
return err
}
- if err = PONRMgr.KVStore.Put(Path, Value); err != nil {
+ if err = PONRMgr.KVStore.Put(ctx, Path, Value); err != nil {
log.Errorf("Failed to update resource %s", Path)
return err
}
@@ -1183,7 +1184,7 @@
}
}
-func (PONRMgr *PONResourceManager) AddOnuGemInfo(intfID uint32, onuGemData interface{}) error {
+func (PONRMgr *PONResourceManager) AddOnuGemInfo(ctx context.Context, intfID uint32, onuGemData interface{}) error {
/*
Update onugem info map,
:param pon_intf_id: reference of PON interface id
@@ -1198,14 +1199,14 @@
return err
}
- if err = PONRMgr.KVStore.Put(Path, Value); err != nil {
+ if err = PONRMgr.KVStore.Put(ctx, Path, Value); err != nil {
log.Errorf("Failed to update resource %s", Path)
return err
}
return err
}
-func (PONRMgr *PONResourceManager) GetOnuGemInfo(IntfId uint32, onuGemInfo interface{}) error {
+func (PONRMgr *PONResourceManager) GetOnuGemInfo(ctx context.Context, IntfId uint32, onuGemInfo interface{}) error {
/*
Get onugeminfo map from kvstore
:param intfid: refremce pon intfid
@@ -1214,7 +1215,7 @@
var Val []byte
path := fmt.Sprintf(ONU_GEM_INFO_PATH, PONRMgr.DeviceID, IntfId)
- value, err := PONRMgr.KVStore.Get(path)
+ value, err := PONRMgr.KVStore.Get(ctx, path)
if err != nil {
log.Errorw("Failed to get from kv store", log.Fields{"path": path})
return err
@@ -1235,14 +1236,14 @@
return err
}
-func (PONRMgr *PONResourceManager) DelOnuGemInfoForIntf(intfId uint32) error {
+func (PONRMgr *PONResourceManager) DelOnuGemInfoForIntf(ctx context.Context, intfId uint32) error {
/*
delete onugem info for an interface from kvstore
:param intfid: refremce pon intfid
*/
path := fmt.Sprintf(ONU_GEM_INFO_PATH, PONRMgr.DeviceID, intfId)
- if err := PONRMgr.KVStore.Delete(path); err != nil {
+ if err := PONRMgr.KVStore.Delete(ctx, path); err != nil {
log.Errorf("Falied to remove resource %s", path)
return err
}
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/techprofile/tech_profile.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/techprofile/tech_profile.go
index 0358291..b268a4c 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/techprofile/tech_profile.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/techprofile/tech_profile.go
@@ -17,6 +17,7 @@
package techprofile
import (
+ "context"
"encoding/json"
"errors"
"fmt"
@@ -32,7 +33,7 @@
// Interface to pon resource manager APIs
type iPonResourceMgr interface {
- GetResourceID(IntfID uint32, ResourceType string, NumIDs uint32) ([]uint32, error)
+ GetResourceID(ctx context.Context, IntfID uint32, ResourceType string, NumIDs uint32) ([]uint32, error)
GetResourceTypeAllocID() string
GetResourceTypeGemPortID() string
GetTechnology() string
@@ -298,13 +299,13 @@
return fmt.Sprintf(t.config.TPInstanceKVPath, t.resourceMgr.GetTechnology(), techProfiletblID, uniPortName)
}
-func (t *TechProfileMgr) GetTPInstanceFromKVStore(techProfiletblID uint32, path string) (*TechProfile, error) {
+func (t *TechProfileMgr) GetTPInstanceFromKVStore(ctx context.Context, techProfiletblID uint32, path string) (*TechProfile, error) {
var KvTpIns TechProfile
var resPtr *TechProfile = &KvTpIns
var err error
var kvResult *kvstore.KVPair
- kvResult, _ = t.config.KVBackend.Get(path)
+ kvResult, _ = t.config.KVBackend.Get(ctx, path)
if kvResult == nil {
log.Infow("tp-instance-not-found-on-kv", log.Fields{"key": path})
return nil, nil
@@ -321,24 +322,24 @@
return nil, err
}
-func (t *TechProfileMgr) addTechProfInstanceToKVStore(techProfiletblID uint32, uniPortName string, tpInstance *TechProfile) error {
+func (t *TechProfileMgr) addTechProfInstanceToKVStore(ctx context.Context, techProfiletblID uint32, uniPortName string, tpInstance *TechProfile) error {
path := t.GetTechProfileInstanceKVPath(techProfiletblID, uniPortName)
log.Debugw("Adding techprof instance to kvstore", log.Fields{"key": path, "tpinstance": tpInstance})
tpInstanceJson, err := json.Marshal(*tpInstance)
if err == nil {
// Backend will convert JSON byte array into string format
log.Debugw("Storing tech profile instance to KV Store", log.Fields{"key": path, "val": tpInstanceJson})
- err = t.config.KVBackend.Put(path, tpInstanceJson)
+ err = t.config.KVBackend.Put(ctx, path, tpInstanceJson)
} else {
log.Errorw("Error in marshaling into Json format", log.Fields{"key": path, "tpinstance": tpInstance})
}
return err
}
-func (t *TechProfileMgr) getTPFromKVStore(techProfiletblID uint32) *DefaultTechProfile {
+func (t *TechProfileMgr) getTPFromKVStore(ctx context.Context, techProfiletblID uint32) *DefaultTechProfile {
var kvtechprofile DefaultTechProfile
key := fmt.Sprintf(t.config.TPFileKVPath, t.resourceMgr.GetTechnology(), techProfiletblID)
log.Debugw("Getting techprofile from KV store", log.Fields{"techProfiletblID": techProfiletblID, "Key": key})
- kvresult, err := t.config.KVBackend.Get(key)
+ kvresult, err := t.config.KVBackend.Get(ctx, key)
if err != nil {
log.Errorw("Error while fetching value from KV store", log.Fields{"key": key})
return nil
@@ -358,7 +359,7 @@
return nil
}
-func (t *TechProfileMgr) CreateTechProfInstance(techProfiletblID uint32, uniPortName string, intfId uint32) (*TechProfile, error) {
+func (t *TechProfileMgr) CreateTechProfInstance(ctx context.Context, techProfiletblID uint32, uniPortName string, intfId uint32) (*TechProfile, error) {
var tpInstance *TechProfile
log.Infow("creating-tp-instance", log.Fields{"tableid": techProfiletblID, "uni": uniPortName, "intId": intfId})
@@ -368,7 +369,7 @@
return nil, errors.New("uni-port-name-not-confirming-to-format")
}
- tp := t.getTPFromKVStore(techProfiletblID)
+ tp := t.getTPFromKVStore(ctx, techProfiletblID)
if tp != nil {
if err := t.validateInstanceControlAttr(tp.InstanceCtrl); err != nil {
log.Error("invalid-instance-ctrl-attr--using-default-tp")
@@ -381,11 +382,11 @@
tp = t.getDefaultTechProfile()
}
tpInstancePath := t.GetTechProfileInstanceKVPath(techProfiletblID, uniPortName)
- if tpInstance = t.allocateTPInstance(uniPortName, tp, intfId, tpInstancePath); tpInstance == nil {
+ if tpInstance = t.allocateTPInstance(ctx, uniPortName, tp, intfId, tpInstancePath); tpInstance == nil {
log.Error("tp-intance-allocation-failed")
return nil, errors.New("tp-intance-allocation-failed")
}
- if err := t.addTechProfInstanceToKVStore(techProfiletblID, uniPortName, tpInstance); err != nil {
+ if err := t.addTechProfInstanceToKVStore(ctx, techProfiletblID, uniPortName, tpInstance); err != nil {
log.Errorw("error-adding-tp-to-kv-store", log.Fields{"tableid": techProfiletblID, "uni": uniPortName})
return nil, errors.New("error-adding-tp-to-kv-store")
}
@@ -394,9 +395,9 @@
return tpInstance, nil
}
-func (t *TechProfileMgr) DeleteTechProfileInstance(techProfiletblID uint32, uniPortName string) error {
+func (t *TechProfileMgr) DeleteTechProfileInstance(ctx context.Context, techProfiletblID uint32, uniPortName string) error {
path := t.GetTechProfileInstanceKVPath(techProfiletblID, uniPortName)
- return t.config.KVBackend.Delete(path)
+ return t.config.KVBackend.Delete(ctx, path)
}
func (t *TechProfileMgr) validateInstanceControlAttr(instCtl InstanceControl) error {
@@ -418,7 +419,7 @@
return nil
}
-func (t *TechProfileMgr) allocateTPInstance(uniPortName string, tp *DefaultTechProfile, intfId uint32, tpInstPath string) *TechProfile {
+func (t *TechProfileMgr) allocateTPInstance(ctx context.Context, uniPortName string, tp *DefaultTechProfile, intfId uint32, tpInstPath string) *TechProfile {
var usGemPortAttributeList []iGemPortAttribute
var dsGemPortAttributeList []iGemPortAttribute
@@ -431,16 +432,16 @@
log.Infow("Allocating TechProfileMgr instance from techprofile template", log.Fields{"uniPortName": uniPortName, "intfId": intfId, "numGem": tp.NumGemPorts})
if tp.InstanceCtrl.Onu == "multi-instance" {
- if tcontIDs, err = t.resourceMgr.GetResourceID(intfId, t.resourceMgr.GetResourceTypeAllocID(), 1); err != nil {
+ if tcontIDs, err = t.resourceMgr.GetResourceID(ctx, intfId, t.resourceMgr.GetResourceTypeAllocID(), 1); err != nil {
log.Errorw("Error getting alloc id from rsrcrMgr", log.Fields{"intfId": intfId})
return nil
}
} else { // "single-instance"
- tpInst, err := t.getSingleInstanceTp(tpInstPath)
+ tpInst, err := t.getSingleInstanceTp(ctx, tpInstPath)
if tpInst == nil {
// No "single-instance" tp found on one any uni port for the given TP ID
// Allocate a new TcontID or AllocID
- if tcontIDs, err = t.resourceMgr.GetResourceID(intfId, t.resourceMgr.GetResourceTypeAllocID(), 1); err != nil {
+ if tcontIDs, err = t.resourceMgr.GetResourceID(ctx, intfId, t.resourceMgr.GetResourceTypeAllocID(), 1); err != nil {
log.Errorw("Error getting alloc id from rsrcrMgr", log.Fields{"intfId": intfId})
return nil
}
@@ -450,7 +451,7 @@
}
}
log.Debugw("Num GEM ports in TP:", log.Fields{"NumGemPorts": tp.NumGemPorts})
- if gemPorts, err = t.resourceMgr.GetResourceID(intfId, t.resourceMgr.GetResourceTypeGemPortID(), tp.NumGemPorts); err != nil {
+ if gemPorts, err = t.resourceMgr.GetResourceID(ctx, intfId, t.resourceMgr.GetResourceTypeGemPortID(), tp.NumGemPorts); err != nil {
log.Errorw("Error getting gemport ids from rsrcrMgr", log.Fields{"intfId": intfId, "numGemports": tp.NumGemPorts})
return nil
}
@@ -544,14 +545,14 @@
// getSingleInstanceTp returns another TpInstance for an ONU on a different
// uni port for the same TP ID, if it finds one, else nil.
-func (t *TechProfileMgr) getSingleInstanceTp(tpPath string) (*TechProfile, error) {
+func (t *TechProfileMgr) getSingleInstanceTp(ctx context.Context, tpPath string) (*TechProfile, error) {
var tpInst TechProfile
// For example:
// tpPath like "service/voltha/technology_profiles/xgspon/64/pon-{0}/onu-{1}/uni-{1}"
// is broken into ["service/voltha/technology_profiles/xgspon/64/pon-{0}/onu-{1}" ""]
uniPathSlice := regexp.MustCompile(`/uni-{[0-9]+}$`).Split(tpPath, 2)
- kvPairs, _ := t.config.KVBackend.List(uniPathSlice[0])
+ kvPairs, _ := t.config.KVBackend.List(ctx, uniPathSlice[0])
// Find a valid TP Instance among all the UNIs of that ONU for the given TP ID
for keyPath, kvPair := range kvPairs {
@@ -899,11 +900,11 @@
}
// FindAllTpInstances returns all TechProfile instances for a given TechProfile table-id, pon interface ID and onu ID.
-func (t *TechProfileMgr) FindAllTpInstances(techProfiletblID uint32, ponIntf uint32, onuID uint32) []TechProfile {
+func (t *TechProfileMgr) FindAllTpInstances(ctx context.Context, techProfiletblID uint32, ponIntf uint32, onuID uint32) []TechProfile {
var tp TechProfile
onuTpInstancePath := fmt.Sprintf("%s/%d/pon-{%d}/onu-{%d}", t.resourceMgr.GetTechnology(), techProfiletblID, ponIntf, onuID)
- if kvPairs, _ := t.config.KVBackend.List(onuTpInstancePath); kvPairs != nil {
+ if kvPairs, _ := t.config.KVBackend.List(ctx, onuTpInstancePath); kvPairs != nil {
tpInstances := make([]TechProfile, 0, len(kvPairs))
for kvPath, kvPair := range kvPairs {
if value, err := kvstore.ToByte(kvPair.Value); err == nil {
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/techprofile/tech_profile_if.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/techprofile/tech_profile_if.go
index 9184b5b..e605d49 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/techprofile/tech_profile_if.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/techprofile/tech_profile_if.go
@@ -17,6 +17,8 @@
package techprofile
import (
+ "context"
+
"github.com/opencord/voltha-lib-go/v3/pkg/db"
tp_pb "github.com/opencord/voltha-protos/v3/go/tech_profile"
)
@@ -24,9 +26,9 @@
type TechProfileIf interface {
SetKVClient() *db.Backend
GetTechProfileInstanceKVPath(techProfiletblID uint32, uniPortName string) string
- GetTPInstanceFromKVStore(techProfiletblID uint32, path string) (*TechProfile, error)
- CreateTechProfInstance(techProfiletblID uint32, uniPortName string, intfId uint32) (*TechProfile, error)
- DeleteTechProfileInstance(techProfiletblID uint32, uniPortName string) error
+ GetTPInstanceFromKVStore(ctx context.Context, techProfiletblID uint32, path string) (*TechProfile, error)
+ CreateTechProfInstance(ctx context.Context, techProfiletblID uint32, uniPortName string, intfId uint32) (*TechProfile, error)
+ DeleteTechProfileInstance(ctx context.Context, techProfiletblID uint32, uniPortName string) error
GetprotoBufParamValue(paramType string, paramKey string) int32
GetUsScheduler(tpInstance *TechProfile) (*tp_pb.SchedulerConfig, error)
GetDsScheduler(tpInstance *TechProfile) (*tp_pb.SchedulerConfig, error)
@@ -35,5 +37,5 @@
GetTrafficQueues(tp *TechProfile, Dir tp_pb.Direction) ([]*tp_pb.TrafficQueue, error)
GetMulticastTrafficQueues(tp *TechProfile) []*tp_pb.TrafficQueue
GetGemportIDForPbit(tp *TechProfile, Dir tp_pb.Direction, pbit uint32) uint32
- FindAllTpInstances(techProfiletblID uint32, ponIntf uint32, onuID uint32) []TechProfile
+ FindAllTpInstances(ctx context.Context, techProfiletblID uint32, ponIntf uint32, onuID uint32) []TechProfile
}
diff --git a/vendor/github.com/opencord/voltha-protos/v3/go/inter_container/inter_container.pb.go b/vendor/github.com/opencord/voltha-protos/v3/go/inter_container/inter_container.pb.go
index 120a94b..880a0a2 100644
--- a/vendor/github.com/opencord/voltha-protos/v3/go/inter_container/inter_container.pb.go
+++ b/vendor/github.com/opencord/voltha-protos/v3/go/inter_container/inter_container.pb.go
@@ -232,16 +232,19 @@
const (
ErrorCode_UNSUPPORTED_REQUEST ErrorCodeCodes = 0
ErrorCode_INVALID_PARAMETERS ErrorCodeCodes = 1
+ ErrorCode_DEADLINE_EXCEEDED ErrorCodeCodes = 2
)
var ErrorCodeCodes_name = map[int32]string{
0: "UNSUPPORTED_REQUEST",
1: "INVALID_PARAMETERS",
+ 2: "DEADLINE_EXCEEDED",
}
var ErrorCodeCodes_value = map[string]int32{
"UNSUPPORTED_REQUEST": 0,
"INVALID_PARAMETERS": 1,
+ "DEADLINE_EXCEEDED": 2,
}
func (x ErrorCodeCodes) String() string {
@@ -492,11 +495,11 @@
var xxx_messageInfo_ErrorCode proto.InternalMessageInfo
type Error struct {
- Code *ErrorCode `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
- Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
+ Code ErrorCodeCodes `protobuf:"varint,1,opt,name=code,proto3,enum=voltha.ErrorCodeCodes" json:"code,omitempty"`
+ Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
}
func (m *Error) Reset() { *m = Error{} }
@@ -524,11 +527,11 @@
var xxx_messageInfo_Error proto.InternalMessageInfo
-func (m *Error) GetCode() *ErrorCode {
+func (m *Error) GetCode() ErrorCodeCodes {
if m != nil {
return m.Code
}
- return nil
+ return ErrorCode_UNSUPPORTED_REQUEST
}
func (m *Error) GetReason() string {
@@ -1470,87 +1473,89 @@
}
var fileDescriptor_941f0031a549667f = []byte{
- // 1311 bytes of a gzipped FileDescriptorProto
+ // 1335 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcb, 0x6e, 0xdb, 0x46,
- 0x14, 0x8d, 0xde, 0xd2, 0x95, 0xad, 0xc8, 0xe3, 0x38, 0x96, 0xed, 0x3c, 0x5c, 0x36, 0xaf, 0xa6,
- 0xad, 0x8c, 0x3a, 0x28, 0xda, 0xac, 0x5a, 0x59, 0xa2, 0x63, 0x02, 0xb6, 0xa4, 0x52, 0x72, 0x02,
- 0x74, 0x43, 0xd0, 0xe4, 0x58, 0x22, 0x4c, 0x71, 0x98, 0xe1, 0xd0, 0x29, 0x37, 0x05, 0xba, 0xeb,
- 0x4f, 0x14, 0xe8, 0xaa, 0x9f, 0x50, 0xa0, 0x7f, 0x57, 0xcc, 0x83, 0x12, 0xa5, 0xc4, 0x0d, 0x90,
- 0xee, 0x38, 0xf7, 0x9c, 0x79, 0x9d, 0x7b, 0xef, 0x19, 0xc2, 0xe7, 0xd7, 0xc4, 0x67, 0x53, 0xdb,
- 0x0a, 0x29, 0x61, 0x24, 0x3a, 0xf0, 0x02, 0x86, 0xa9, 0xe5, 0x90, 0x80, 0xd9, 0x5e, 0x80, 0x69,
- 0x5b, 0x84, 0x51, 0x59, 0x92, 0x76, 0x77, 0x97, 0xc9, 0x0e, 0x99, 0xcd, 0x48, 0x20, 0x39, 0xab,
- 0x98, 0x1c, 0x29, 0x6c, 0x67, 0x42, 0xc8, 0xc4, 0xc7, 0x07, 0x62, 0x74, 0x11, 0x5f, 0x1e, 0xd8,
- 0x41, 0xa2, 0xa0, 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aa, 0xa0, 0x52, 0xbf, 0xd5, 0x0a, 0x3d, 0xfd, 0xf8, 0x4d, 0x76, 0x72, 0x43,
+ 0xde, 0x65, 0xe8, 0x6b, 0x28, 0x92, 0xb9, 0xe3, 0xa9, 0x7a, 0x3e, 0xf8, 0xd0, 0xbc, 0x64, 0xba,
+ 0x8c, 0x6f, 0xe3, 0xf4, 0xe3, 0xda, 0xe2, 0xd9, 0xa4, 0x45, 0xb0, 0xf5, 0x81, 0xe9, 0x42, 0x47,
+ 0x6b, 0xd7, 0xee, 0xde, 0x87, 0x5c, 0x7f, 0xea, 0x15, 0xfc, 0xf4, 0x5b, 0xa8, 0x67, 0xc6, 0x18,
+ 0xd5, 0xa1, 0xb2, 0x54, 0xc4, 0x0d, 0xa8, 0x66, 0xc4, 0x50, 0xbc, 0xbf, 0x5e, 0x1b, 0x5d, 0xdd,
+ 0xea, 0x19, 0xe3, 0xee, 0xf0, 0xb5, 0x6e, 0xf2, 0xf7, 0xd7, 0xf1, 0x00, 0xb6, 0x08, 0x9d, 0x8a,
+ 0x0b, 0xc6, 0x21, 0xd4, 0x55, 0x87, 0xfb, 0xf1, 0x9b, 0xa9, 0xc7, 0x66, 0xf1, 0x39, 0x9f, 0x8c,
+ 0xc3, 0x14, 0x53, 0x4f, 0xde, 0x2f, 0xd3, 0x07, 0xf0, 0xf3, 0xc3, 0x29, 0x59, 0x7f, 0x4f, 0x8f,
+ 0x6e, 0x8c, 0x72, 0xa3, 0xe2, 0x79, 0x59, 0x70, 0x9e, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xd4,
+ 0x59, 0x12, 0xf3, 0x7d, 0x0b, 0x00, 0x00,
}
diff --git a/vendor/github.com/opencord/voltha-protos/v3/go/voltha/adapter.pb.go b/vendor/github.com/opencord/voltha-protos/v3/go/voltha/adapter.pb.go
index 93bf21b..1f24221 100644
--- a/vendor/github.com/opencord/voltha-protos/v3/go/voltha/adapter.pb.go
+++ b/vendor/github.com/opencord/voltha-protos/v3/go/voltha/adapter.pb.go
@@ -7,6 +7,7 @@
fmt "fmt"
proto "github.com/golang/protobuf/proto"
any "github.com/golang/protobuf/ptypes/any"
+ timestamp "github.com/golang/protobuf/ptypes/timestamp"
common "github.com/opencord/voltha-protos/v3/go/common"
math "math"
)
@@ -83,9 +84,11 @@
// Custom descriptors and custom configuration
AdditionalDescription *any.Any `protobuf:"bytes,64,opt,name=additional_description,json=additionalDescription,proto3" json:"additional_description,omitempty"`
LogicalDeviceIds []string `protobuf:"bytes,4,rep,name=logical_device_ids,json=logicalDeviceIds,proto3" json:"logical_device_ids,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
+ // timestamp when the adapter last sent a message to the core
+ LastCommunication *timestamp.Timestamp `protobuf:"bytes,5,opt,name=last_communication,json=lastCommunication,proto3" json:"last_communication,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
}
func (m *Adapter) Reset() { *m = Adapter{} }
@@ -155,6 +158,13 @@
return nil
}
+func (m *Adapter) GetLastCommunication() *timestamp.Timestamp {
+ if m != nil {
+ return m.LastCommunication
+ }
+ return nil
+}
+
type Adapters struct {
Items []*Adapter `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@@ -203,30 +213,33 @@
func init() { proto.RegisterFile("voltha_protos/adapter.proto", fileDescriptor_7e998ce153307274) }
var fileDescriptor_7e998ce153307274 = []byte{
- // 397 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x41, 0x8e, 0xda, 0x30,
- 0x14, 0x86, 0x95, 0xd0, 0xc9, 0x0c, 0x1e, 0x4d, 0x4b, 0xdd, 0x82, 0x52, 0x2a, 0xd4, 0x08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b, 0xf6, 0xdf, 0xa6, 0x57,
+ 0x4d, 0xd7, 0xfd, 0x61, 0xd3, 0xf4, 0x2b, 0x3a, 0x0f, 0x5b, 0x1a, 0xfc, 0x19, 0xf5, 0xa4, 0xe5,
+ 0x85, 0x89, 0xa3, 0x49, 0x77, 0x76, 0x31, 0x7f, 0x77, 0x72, 0x86, 0xd4, 0xb3, 0xab, 0x35, 0x7a,
+ 0x0f, 0x95, 0x20, 0x50, 0x72, 0x9d, 0x43, 0xc5, 0x82, 0x6a, 0x75, 0xf9, 0xdd, 0x7d, 0x83, 0xf8,
+ 0x07, 0x11, 0xd2, 0xbe, 0x6c, 0x37, 0xcd, 0x13, 0x49, 0x5a, 0x69, 0xe2, 0xa5, 0x77, 0xe1, 0x41,
+ 0xd6, 0x8b, 0x44, 0x40, 0xc0, 0x36, 0x7d, 0x07, 0x2e, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, 0x4d,
+ 0xb1, 0x4a, 0xa8, 0x11, 0x03, 0x00, 0x00,
}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index a9bf83f..b0e4ee5 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -35,8 +35,8 @@
github.com/golang/protobuf/proto
github.com/golang/protobuf/ptypes/any
github.com/golang/protobuf/ptypes/empty
-github.com/golang/protobuf/ptypes/duration
github.com/golang/protobuf/ptypes/timestamp
+github.com/golang/protobuf/ptypes/duration
github.com/golang/protobuf/protoc-gen-go/descriptor
# github.com/golang/snappy v0.0.1
github.com/golang/snappy
@@ -63,7 +63,7 @@
github.com/mitchellh/go-homedir
# github.com/mitchellh/mapstructure v1.1.2
github.com/mitchellh/mapstructure
-# github.com/opencord/voltha-lib-go/v3 v3.0.0
+# github.com/opencord/voltha-lib-go/v3 v3.0.5
github.com/opencord/voltha-lib-go/v3/pkg/adapters
github.com/opencord/voltha-lib-go/v3/pkg/adapters/adapterif
github.com/opencord/voltha-lib-go/v3/pkg/adapters/common
@@ -76,7 +76,7 @@
github.com/opencord/voltha-lib-go/v3/pkg/techprofile
github.com/opencord/voltha-lib-go/v3/pkg/db
github.com/opencord/voltha-lib-go/v3/pkg/ponresourcemanager
-# github.com/opencord/voltha-protos/v3 v3.1.0
+# github.com/opencord/voltha-protos/v3 v3.2.1
github.com/opencord/voltha-protos/v3/go/inter_container
github.com/opencord/voltha-protos/v3/go/voltha
github.com/opencord/voltha-protos/v3/go/common