[VOL-5567] Update protos
Change-Id: Ib4ec57241aab48d918fc33448020c876882d5abc
Signed-off-by: Abhay Kumar <abhay.kumar@radisys.com>
diff --git a/pkg/grpc/client.go b/pkg/grpc/client.go
index 6d8a93c..5fcc8dc 100644
--- a/pkg/grpc/client.go
+++ b/pkg/grpc/client.go
@@ -37,7 +37,7 @@
"github.com/opencord/voltha-protos/v5/go/onu_inter_adapter_service"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
- rpb "google.golang.org/grpc/reflection/grpc_reflection_v1alpha"
+ "google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/status"
)
@@ -291,7 +291,7 @@
// Get a new client using reflection. The server can implement any grpc service, but it
// needs to also implement the "StartKeepAliveStream" API
- grpcReflectClient := grpcreflect.NewClient(ctx, rpb.NewServerReflectionClient(conn))
+ grpcReflectClient := grpcreflect.NewClientAuto(ctx, conn)
if grpcReflectClient == nil {
logger.Errorw(ctx, "grpc-reflect-client-nil", log.Fields{"api-endpoint": c.serverEndPoint, "client": c.clientEndpoint})
return
@@ -621,8 +621,8 @@
if len(retry_interceptor) > 0 {
interceptor_opts = append(interceptor_opts, retry_interceptor...)
}
- conn, err := grpc.Dial(c.serverEndPoint,
- grpc.WithInsecure(),
+ conn, err := grpc.NewClient(c.serverEndPoint,
+ grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(grpcRecvMsgSizeLimit*1024*1024)),
grpc.WithStreamInterceptor(grpc_middleware.ChainStreamClient(
grpc_opentracing.StreamClientInterceptor(grpc_opentracing.WithTracer(log.ActiveTracerProxy{})),
diff --git a/pkg/grpc/mock_core_service.go b/pkg/grpc/mock_core_service.go
index 5c78dff..e695102 100644
--- a/pkg/grpc/mock_core_service.go
+++ b/pkg/grpc/mock_core_service.go
@@ -21,17 +21,18 @@
"strconv"
"time"
- "github.com/golang/protobuf/ptypes/empty"
"github.com/opencord/voltha-lib-go/v7/pkg/log"
"github.com/opencord/voltha-protos/v5/go/common"
ca "github.com/opencord/voltha-protos/v5/go/core_adapter"
"github.com/opencord/voltha-protos/v5/go/core_service"
"github.com/opencord/voltha-protos/v5/go/health"
"github.com/opencord/voltha-protos/v5/go/voltha"
+ "google.golang.org/protobuf/types/known/emptypb"
)
// MockCoreServiceHandler implements the methods in the core service
type MockCoreServiceHandler struct {
+ core_service.UnimplementedCoreServiceServer
exitChannel chan struct{}
}
@@ -48,25 +49,25 @@
close(handler.exitChannel)
}
-func (handler *MockCoreServiceHandler) RegisterAdapter(ctx context.Context, reg *ca.AdapterRegistration) (*empty.Empty, error) {
+func (handler *MockCoreServiceHandler) RegisterAdapter(ctx context.Context, reg *ca.AdapterRegistration) (*emptypb.Empty, error) {
//logger.Debugw(ctx, "registration-received", log.Fields{"input": reg})
- return &empty.Empty{}, nil
+ return &emptypb.Empty{}, nil
}
-func (handler *MockCoreServiceHandler) DeviceUpdate(context.Context, *voltha.Device) (*empty.Empty, error) {
- return &empty.Empty{}, nil
+func (handler *MockCoreServiceHandler) DeviceUpdate(context.Context, *voltha.Device) (*emptypb.Empty, error) {
+ return &emptypb.Empty{}, nil
}
-func (handler *MockCoreServiceHandler) PortCreated(context.Context, *voltha.Port) (*empty.Empty, error) {
- return &empty.Empty{}, nil
+func (handler *MockCoreServiceHandler) PortCreated(context.Context, *voltha.Port) (*emptypb.Empty, error) {
+ return &emptypb.Empty{}, nil
}
-func (handler *MockCoreServiceHandler) PortsStateUpdate(context.Context, *ca.PortStateFilter) (*empty.Empty, error) {
- return &empty.Empty{}, nil
+func (handler *MockCoreServiceHandler) PortsStateUpdate(context.Context, *ca.PortStateFilter) (*emptypb.Empty, error) {
+ return &emptypb.Empty{}, nil
}
-func (handler *MockCoreServiceHandler) DeleteAllPorts(context.Context, *common.ID) (*empty.Empty, error) {
- return &empty.Empty{}, nil
+func (handler *MockCoreServiceHandler) DeleteAllPorts(context.Context, *common.ID) (*emptypb.Empty, error) {
+ return &emptypb.Empty{}, nil
}
func (handler *MockCoreServiceHandler) GetDevicePort(context.Context, *ca.PortFilter) (*voltha.Port, error) {
@@ -77,25 +78,25 @@
return &voltha.Ports{}, nil
}
-func (handler *MockCoreServiceHandler) DeviceStateUpdate(context.Context, *ca.DeviceStateFilter) (*empty.Empty, error) {
- return &empty.Empty{}, nil
+func (handler *MockCoreServiceHandler) DeviceStateUpdate(context.Context, *ca.DeviceStateFilter) (*emptypb.Empty, error) {
+ return &emptypb.Empty{}, nil
}
-func (handler *MockCoreServiceHandler) DevicePMConfigUpdate(context.Context, *voltha.PmConfigs) (*empty.Empty, error) {
- return &empty.Empty{}, nil
+func (handler *MockCoreServiceHandler) DevicePMConfigUpdate(context.Context, *voltha.PmConfigs) (*emptypb.Empty, error) {
+ return &emptypb.Empty{}, nil
}
func (handler *MockCoreServiceHandler) ChildDeviceDetected(context.Context, *ca.DeviceDiscovery) (*voltha.Device, error) {
return &voltha.Device{}, nil
}
-func (handler *MockCoreServiceHandler) ChildDevicesLost(context.Context, *common.ID) (*empty.Empty, error) {
- return &empty.Empty{}, nil
+func (handler *MockCoreServiceHandler) ChildDevicesLost(context.Context, *common.ID) (*emptypb.Empty, error) {
+ return &emptypb.Empty{}, nil
}
-func (handler *MockCoreServiceHandler) ChildDevicesDetected(context.Context, *common.ID) (*empty.Empty, error) {
+func (handler *MockCoreServiceHandler) ChildDevicesDetected(context.Context, *common.ID) (*emptypb.Empty, error) {
time.Sleep(50 * time.Millisecond)
- return &empty.Empty{}, nil
+ return &emptypb.Empty{}, nil
}
func (handler *MockCoreServiceHandler) GetDevice(ctx context.Context, id *common.ID) (*voltha.Device, error) {
@@ -116,21 +117,21 @@
return &voltha.Devices{}, nil
}
-func (handler *MockCoreServiceHandler) SendPacketIn(context.Context, *ca.PacketIn) (*empty.Empty, error) {
- return &empty.Empty{}, nil
+func (handler *MockCoreServiceHandler) SendPacketIn(context.Context, *ca.PacketIn) (*emptypb.Empty, error) {
+ return &emptypb.Empty{}, nil
}
-func (handler *MockCoreServiceHandler) DeviceReasonUpdate(context.Context, *ca.DeviceReason) (*empty.Empty, error) {
- return &empty.Empty{}, nil
+func (handler *MockCoreServiceHandler) DeviceReasonUpdate(context.Context, *ca.DeviceReason) (*emptypb.Empty, error) {
+ return &emptypb.Empty{}, nil
}
-func (handler *MockCoreServiceHandler) PortStateUpdate(context.Context, *ca.PortState) (*empty.Empty, error) {
- return &empty.Empty{}, nil
+func (handler *MockCoreServiceHandler) PortStateUpdate(context.Context, *ca.PortState) (*emptypb.Empty, error) {
+ return &emptypb.Empty{}, nil
}
// Additional API found in the Core - unused?
-func (handler *MockCoreServiceHandler) ReconcileChildDevices(context.Context, *common.ID) (*empty.Empty, error) {
- return &empty.Empty{}, nil
+func (handler *MockCoreServiceHandler) ReconcileChildDevices(context.Context, *common.ID) (*emptypb.Empty, error) {
+ return &emptypb.Empty{}, nil
}
func (handler *MockCoreServiceHandler) GetChildDeviceWithProxyAddress(context.Context, *voltha.Device_ProxyAddress) (*voltha.Device, error) {
@@ -141,12 +142,12 @@
return &voltha.Ports{}, nil
}
-func (handler *MockCoreServiceHandler) ChildrenStateUpdate(context.Context, *ca.DeviceStateFilter) (*empty.Empty, error) {
- return &empty.Empty{}, nil
+func (handler *MockCoreServiceHandler) ChildrenStateUpdate(context.Context, *ca.DeviceStateFilter) (*emptypb.Empty, error) {
+ return &emptypb.Empty{}, nil
}
-func (handler *MockCoreServiceHandler) UpdateImageDownload(context.Context, *voltha.ImageDownload) (*empty.Empty, error) {
- return &empty.Empty{}, nil
+func (handler *MockCoreServiceHandler) UpdateImageDownload(context.Context, *voltha.ImageDownload) (*emptypb.Empty, error) {
+ return &emptypb.Empty{}, nil
}
func (handler *MockCoreServiceHandler) GetHealthStatus(stream core_service.CoreService_GetHealthStatusServer) error {