diff --git a/internal/csi-addons/rbd/replication.go b/internal/csi-addons/rbd/replication.go index 97e30ba7e..c867e5203 100644 --- a/internal/csi-addons/rbd/replication.go +++ b/internal/csi-addons/rbd/replication.go @@ -82,6 +82,12 @@ type ReplicationServer struct { *corerbd.ControllerServer } +// NewReplicationServer creates a new ReplicationServer which handles +// the Replication Service requests from the CSI-Addons specification. +func NewReplicationServer(c *corerbd.ControllerServer) *ReplicationServer { + return &ReplicationServer{ControllerServer: c} +} + func (rs *ReplicationServer) RegisterService(server grpc.ServiceRegistrar) { replication.RegisterControllerServer(server, rs) } diff --git a/internal/rbd/driver/driver.go b/internal/rbd/driver/driver.go index 3deca01b6..950a063af 100644 --- a/internal/rbd/driver/driver.go +++ b/internal/rbd/driver/driver.go @@ -33,12 +33,10 @@ import ( // Driver contains the default identity,node and controller struct. type Driver struct { - cd *csicommon.CSIDriver - + cd *csicommon.CSIDriver ids *rbd.IdentityServer ns *rbd.NodeServer cs *rbd.ControllerServer - rs *casrbd.ReplicationServer // cas is the CSIAddonsServer where CSI-Addons services are handled cas *csiaddons.CSIAddonsServer @@ -66,10 +64,6 @@ func NewControllerServer(d *csicommon.CSIDriver) *rbd.ControllerServer { } } -func NewReplicationServer(c *rbd.ControllerServer) *casrbd.ReplicationServer { - return &casrbd.ReplicationServer{ControllerServer: c} -} - // NewNodeServer initialize a node server for rbd CSI driver. func NewNodeServer( d *csicommon.CSIDriver, @@ -105,12 +99,6 @@ func (r *Driver) Run(conf *util.Config) { // Create instances of the volume and snapshot journal rbd.InitJournals(conf.InstanceID) - // configre CSI-Addons server and components - err = r.setupCSIAddonsServer(conf) - if err != nil { - log.FatalLogMsg(err.Error()) - } - // Initialize default library driver r.cd = csicommon.NewCSIDriver(conf.DriverName, util.DriverVersion, conf.NodeID) if r.cd == nil { @@ -175,9 +163,12 @@ func (r *Driver) Run(conf *util.Config) { r.cs = NewControllerServer(r.cd) r.cs.ClusterName = conf.ClusterName r.cs.SetMetadata = conf.SetMetadata - log.WarningLogMsg("replication service running on controller server is deprecated " + - "and replaced by CSI-Addons, see https://github.com/ceph/ceph-csi/issues/3314 for more details") - r.rs = NewReplicationServer(r.cs) + } + + // configre CSI-Addons server and components + err = r.setupCSIAddonsServer(conf) + if err != nil { + log.FatalLogMsg(err.Error()) } s := csicommon.NewNonBlockingGRPCServer() @@ -185,9 +176,6 @@ 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.rs, } s.Start(conf.Endpoint, conf.HistogramOption, srv, conf.EnableGRPCMetrics) if conf.EnableGRPCMetrics { @@ -231,7 +219,7 @@ func (r *Driver) setupCSIAddonsServer(conf *util.Config) error { fcs := casrbd.NewFenceControllerServer() r.cas.RegisterService(fcs) - rcs := NewReplicationServer(NewControllerServer(r.cd)) + rcs := casrbd.NewReplicationServer(NewControllerServer(r.cd)) r.cas.RegisterService(rcs) }