util: register replication controller

as RBD is implementing the replication
we are registering it. For CephFS, its
not implementing the replication we are
passing nil so we dont want to register
it.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2021-02-09 13:03:11 +05:30 committed by mergify[bot]
parent ee0576278f
commit c642637cec
3 changed files with 10 additions and 0 deletions

View File

@ -156,6 +156,8 @@ func (fs *Driver) Run(conf *util.Config) {
IS: fs.is,
CS: fs.cs,
NS: fs.ns,
// passing nil for replication server as cephFS does not support mirroring.
RS: nil,
}
server.Start(conf.Endpoint, conf.HistogramOption, srv, conf.EnableGRPCMetrics)
if conf.EnableGRPCMetrics {

View File

@ -26,6 +26,7 @@ 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/kube-storage/spec/lib/go/replication"
"github.com/prometheus/client_golang/prometheus"
"google.golang.org/grpc"
klog "k8s.io/klog/v2"
@ -50,6 +51,7 @@ type Servers struct {
IS csi.IdentityServer
CS csi.ControllerServer
NS csi.NodeServer
RS replication.ControllerServer
}
// NewNonBlockingGRPCServer return non-blocking GRPC.
@ -122,6 +124,10 @@ func (s *nonBlockingGRPCServer) serve(endpoint, hstOptions string, srv Servers,
if srv.NS != nil {
csi.RegisterNodeServer(server, srv.NS)
}
if srv.RS != nil {
replication.RegisterControllerServer(server, srv.RS)
}
util.DefaultLog("Listening for connections on address: %#v", listener.Addr())
if metrics {
ho := strings.Split(hstOptions, ",")

View File

@ -172,6 +172,8 @@ func (r *Driver) Run(conf *util.Config) {
IS: r.ids,
CS: r.cs,
NS: r.ns,
// Register the replication controller to expose replication operations.
RS: r.cs,
}
s.Start(conf.Endpoint, conf.HistogramOption, srv, conf.EnableGRPCMetrics)
if conf.EnableGRPCMetrics {