mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-24 23:30:20 +00:00
util: remove metrics argument from NewMiddlewareServerOption
This commit removes metrics argument from NewMiddlewareServerOption as it always set to false. Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
parent
0c13a70363
commit
e9983306d9
@ -87,7 +87,7 @@ func (cas *CSIAddonsServer) RegisterService(svc CSIAddonsService) {
|
|||||||
// returned.
|
// returned.
|
||||||
func (cas *CSIAddonsServer) Start() error {
|
func (cas *CSIAddonsServer) Start() error {
|
||||||
// create the gRPC server and register services
|
// create the gRPC server and register services
|
||||||
cas.server = grpc.NewServer(csicommon.NewMiddlewareServerOption(false))
|
cas.server = grpc.NewServer(csicommon.NewMiddlewareServerOption())
|
||||||
|
|
||||||
for _, svc := range cas.services {
|
for _, svc := range cas.services {
|
||||||
svc.RegisterService(cas.server)
|
svc.RegisterService(cas.server)
|
||||||
|
@ -97,7 +97,7 @@ func (s *nonBlockingGRPCServer) serve(endpoint string, srv Servers) {
|
|||||||
klog.Fatalf("Failed to listen: %v", err)
|
klog.Fatalf("Failed to listen: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
server := grpc.NewServer(NewMiddlewareServerOption(false))
|
server := grpc.NewServer(NewMiddlewareServerOption())
|
||||||
s.server = server
|
s.server = server
|
||||||
|
|
||||||
if srv.IS != nil {
|
if srv.IS != nil {
|
||||||
|
@ -29,7 +29,6 @@ import (
|
|||||||
|
|
||||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
"github.com/container-storage-interface/spec/lib/go/csi"
|
||||||
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||||
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
|
||||||
"github.com/kubernetes-csi/csi-lib-utils/protosanitizer"
|
"github.com/kubernetes-csi/csi-lib-utils/protosanitizer"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
@ -93,13 +92,9 @@ func NewControllerServiceCapability(ctrlCap csi.ControllerServiceCapability_RPC_
|
|||||||
|
|
||||||
// NewMiddlewareServerOption creates a new grpc.ServerOption that configures a
|
// NewMiddlewareServerOption creates a new grpc.ServerOption that configures a
|
||||||
// common format for log messages and other gRPC related handlers.
|
// common format for log messages and other gRPC related handlers.
|
||||||
func NewMiddlewareServerOption(withMetrics bool) grpc.ServerOption {
|
func NewMiddlewareServerOption() grpc.ServerOption {
|
||||||
middleWare := []grpc.UnaryServerInterceptor{contextIDInjector, logGRPC, panicHandler}
|
middleWare := []grpc.UnaryServerInterceptor{contextIDInjector, logGRPC, panicHandler}
|
||||||
|
|
||||||
if withMetrics {
|
|
||||||
middleWare = append(middleWare, grpc_prometheus.UnaryServerInterceptor)
|
|
||||||
}
|
|
||||||
|
|
||||||
return grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(middleWare...))
|
return grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(middleWare...))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user