mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 06:10:22 +00:00
cleanup: remove left-overs of ReplicationServer in csi-common
The ReplicationServer is not used anymore, the functionality has moved to CSI-Addons and the `internal/csi-addons/rbd` package. These last references were not activated anywhere, so can be removed without any impact. See-also: #3314 Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
parent
9f753889ed
commit
76d9400725
@ -166,8 +166,6 @@ func (fs *Driver) Run(conf *util.Config) {
|
|||||||
IS: fs.is,
|
IS: fs.is,
|
||||||
CS: fs.cs,
|
CS: fs.cs,
|
||||||
NS: fs.ns,
|
NS: fs.ns,
|
||||||
// passing nil for replication server as cephFS does not support mirroring.
|
|
||||||
RS: nil,
|
|
||||||
}
|
}
|
||||||
server.Start(conf.Endpoint, srv)
|
server.Start(conf.Endpoint, srv)
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ import (
|
|||||||
"github.com/ceph/ceph-csi/internal/util/log"
|
"github.com/ceph/ceph-csi/internal/util/log"
|
||||||
|
|
||||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
"github.com/container-storage-interface/spec/lib/go/csi"
|
||||||
"github.com/csi-addons/spec/lib/go/replication"
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
)
|
)
|
||||||
@ -46,7 +45,6 @@ type Servers struct {
|
|||||||
IS csi.IdentityServer
|
IS csi.IdentityServer
|
||||||
CS csi.ControllerServer
|
CS csi.ControllerServer
|
||||||
NS csi.NodeServer
|
NS csi.NodeServer
|
||||||
RS replication.ControllerServer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNonBlockingGRPCServer return non-blocking GRPC.
|
// NewNonBlockingGRPCServer return non-blocking GRPC.
|
||||||
@ -111,9 +109,6 @@ func (s *nonBlockingGRPCServer) serve(endpoint string, srv Servers) {
|
|||||||
if srv.NS != nil {
|
if srv.NS != nil {
|
||||||
csi.RegisterNodeServer(server, srv.NS)
|
csi.RegisterNodeServer(server, srv.NS)
|
||||||
}
|
}
|
||||||
if srv.RS != nil {
|
|
||||||
replication.RegisterControllerServer(server, srv.RS)
|
|
||||||
}
|
|
||||||
|
|
||||||
log.DefaultLog("Listening for connections on address: %#v", listener.Addr())
|
log.DefaultLog("Listening for connections on address: %#v", listener.Addr())
|
||||||
err = server.Serve(listener)
|
err = server.Serve(listener)
|
||||||
|
@ -28,8 +28,6 @@ import (
|
|||||||
"github.com/ceph/ceph-csi/internal/util/log"
|
"github.com/ceph/ceph-csi/internal/util/log"
|
||||||
|
|
||||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
"github.com/container-storage-interface/spec/lib/go/csi"
|
||||||
rp "github.com/csi-addons/replication-lib-utils/protosanitizer"
|
|
||||||
"github.com/csi-addons/spec/lib/go/replication"
|
|
||||||
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"
|
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"
|
||||||
@ -93,22 +91,6 @@ func NewControllerServiceCapability(ctrlCap csi.ControllerServiceCapability_RPC_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add replication request names to the list when we implement more API's.
|
|
||||||
func isReplicationRequest(req interface{}) bool {
|
|
||||||
isReplicationRequest := true
|
|
||||||
switch req.(type) {
|
|
||||||
case *replication.EnableVolumeReplicationRequest:
|
|
||||||
case *replication.DisableVolumeReplicationRequest:
|
|
||||||
case *replication.PromoteVolumeRequest:
|
|
||||||
case *replication.DemoteVolumeRequest:
|
|
||||||
case *replication.ResyncVolumeRequest:
|
|
||||||
default:
|
|
||||||
isReplicationRequest = false
|
|
||||||
}
|
|
||||||
|
|
||||||
return isReplicationRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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(withMetrics bool) grpc.ServerOption {
|
||||||
@ -151,19 +133,6 @@ func getReqID(req interface{}) string {
|
|||||||
|
|
||||||
case *csi.NodeExpandVolumeRequest:
|
case *csi.NodeExpandVolumeRequest:
|
||||||
reqID = r.VolumeId
|
reqID = r.VolumeId
|
||||||
|
|
||||||
case *replication.EnableVolumeReplicationRequest:
|
|
||||||
reqID = r.VolumeId
|
|
||||||
case *replication.DisableVolumeReplicationRequest:
|
|
||||||
reqID = r.VolumeId
|
|
||||||
|
|
||||||
case *replication.PromoteVolumeRequest:
|
|
||||||
reqID = r.VolumeId
|
|
||||||
case *replication.DemoteVolumeRequest:
|
|
||||||
reqID = r.VolumeId
|
|
||||||
|
|
||||||
case *replication.ResyncVolumeRequest:
|
|
||||||
reqID = r.VolumeId
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return reqID
|
return reqID
|
||||||
@ -193,18 +162,8 @@ func logGRPC(
|
|||||||
handler grpc.UnaryHandler,
|
handler grpc.UnaryHandler,
|
||||||
) (interface{}, error) {
|
) (interface{}, error) {
|
||||||
log.ExtendedLog(ctx, "GRPC call: %s", info.FullMethod)
|
log.ExtendedLog(ctx, "GRPC call: %s", info.FullMethod)
|
||||||
// TODO: remove the following check for next release
|
log.TraceLog(ctx, "GRPC request: %s", protosanitizer.StripSecrets(req))
|
||||||
// refer to https://github.com/ceph/ceph-csi/issues/3314.
|
|
||||||
if isReplicationRequest(req) {
|
|
||||||
strippedMessage := protosanitizer.StripSecrets(req).String()
|
|
||||||
if !strings.Contains(strippedMessage, "***stripped***") {
|
|
||||||
strippedMessage = rp.StripReplicationSecrets(req).String()
|
|
||||||
}
|
|
||||||
|
|
||||||
log.TraceLog(ctx, "GRPC request: %s", strippedMessage)
|
|
||||||
} else {
|
|
||||||
log.TraceLog(ctx, "GRPC request: %s", protosanitizer.StripSecrets(req))
|
|
||||||
}
|
|
||||||
resp, err := handler(ctx, req)
|
resp, err := handler(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Errorf(log.Log(ctx, "GRPC error: %v"), err)
|
klog.Errorf(log.Log(ctx, "GRPC error: %v"), err)
|
||||||
|
Loading…
Reference in New Issue
Block a user