diff --git a/internal/cephfs/driver.go b/internal/cephfs/driver.go index 2523cf46e..66921b656 100644 --- a/internal/cephfs/driver.go +++ b/internal/cephfs/driver.go @@ -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 { diff --git a/internal/csi-common/server.go b/internal/csi-common/server.go index 1ef6d0a4e..b76d362b0 100644 --- a/internal/csi-common/server.go +++ b/internal/csi-common/server.go @@ -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, ",") diff --git a/internal/rbd/driver.go b/internal/rbd/driver.go index fe0927e83..1414e0494 100644 --- a/internal/rbd/driver.go +++ b/internal/rbd/driver.go @@ -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 {