mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-25 14:30:22 +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.
|
||||
func (cas *CSIAddonsServer) Start() error {
|
||||
// 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 {
|
||||
svc.RegisterService(cas.server)
|
||||
|
@ -97,7 +97,7 @@ func (s *nonBlockingGRPCServer) serve(endpoint string, srv Servers) {
|
||||
klog.Fatalf("Failed to listen: %v", err)
|
||||
}
|
||||
|
||||
server := grpc.NewServer(NewMiddlewareServerOption(false))
|
||||
server := grpc.NewServer(NewMiddlewareServerOption())
|
||||
s.server = server
|
||||
|
||||
if srv.IS != nil {
|
||||
|
@ -29,7 +29,6 @@ import (
|
||||
|
||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
||||
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"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
@ -93,13 +92,9 @@ func NewControllerServiceCapability(ctrlCap csi.ControllerServiceCapability_RPC_
|
||||
|
||||
// NewMiddlewareServerOption creates a new grpc.ServerOption that configures a
|
||||
// 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}
|
||||
|
||||
if withMetrics {
|
||||
middleWare = append(middleWare, grpc_prometheus.UnaryServerInterceptor)
|
||||
}
|
||||
|
||||
return grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(middleWare...))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user