mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 06:10:22 +00:00
rbd: add replication capability & service to csiaddons server
csi-addons server will advertise replication capability and replication service will run with csi-addons server too. Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
parent
cb9ec35e3a
commit
19e4146fab
@ -90,6 +90,12 @@ func (is *IdentityServer) GetCapabilities(
|
|||||||
Type: identity.Capability_NetworkFence_NETWORK_FENCE,
|
Type: identity.Capability_NetworkFence_NETWORK_FENCE,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
}, &identity.Capability{
|
||||||
|
Type: &identity.Capability_VolumeReplication_{
|
||||||
|
VolumeReplication: &identity.Capability_VolumeReplication{
|
||||||
|
Type: identity.Capability_VolumeReplication_VOLUME_REPLICATION,
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,6 +159,8 @@ func (r *Driver) Run(conf *util.Config) {
|
|||||||
r.cs = NewControllerServer(r.cd)
|
r.cs = NewControllerServer(r.cd)
|
||||||
r.cs.ClusterName = conf.ClusterName
|
r.cs.ClusterName = conf.ClusterName
|
||||||
r.cs.SetMetadata = conf.SetMetadata
|
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)
|
r.rs = NewReplicationServer(r.cs)
|
||||||
}
|
}
|
||||||
if !conf.IsControllerServer && !conf.IsNodeServer {
|
if !conf.IsControllerServer && !conf.IsNodeServer {
|
||||||
@ -223,6 +225,9 @@ func (r *Driver) setupCSIAddonsServer(conf *util.Config) error {
|
|||||||
|
|
||||||
fcs := casrbd.NewFenceControllerServer()
|
fcs := casrbd.NewFenceControllerServer()
|
||||||
r.cas.RegisterService(fcs)
|
r.cas.RegisterService(fcs)
|
||||||
|
|
||||||
|
rcs := NewReplicationServer(NewControllerServer(r.cd))
|
||||||
|
r.cas.RegisterService(rcs)
|
||||||
}
|
}
|
||||||
|
|
||||||
if conf.IsNodeServer {
|
if conf.IsNodeServer {
|
||||||
|
@ -32,6 +32,7 @@ import (
|
|||||||
librbd "github.com/ceph/go-ceph/rbd"
|
librbd "github.com/ceph/go-ceph/rbd"
|
||||||
"github.com/ceph/go-ceph/rbd/admin"
|
"github.com/ceph/go-ceph/rbd/admin"
|
||||||
"github.com/csi-addons/spec/lib/go/replication"
|
"github.com/csi-addons/spec/lib/go/replication"
|
||||||
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
)
|
)
|
||||||
@ -91,6 +92,10 @@ type ReplicationServer struct {
|
|||||||
*ControllerServer
|
*ControllerServer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rs *ReplicationServer) RegisterService(server grpc.ServiceRegistrar) {
|
||||||
|
replication.RegisterControllerServer(server, rs)
|
||||||
|
}
|
||||||
|
|
||||||
// getForceOption extracts the force option from the GRPC request parameters.
|
// getForceOption extracts the force option from the GRPC request parameters.
|
||||||
// If not set, the default will be set to false.
|
// If not set, the default will be set to false.
|
||||||
func getForceOption(ctx context.Context, parameters map[string]string) (bool, error) {
|
func getForceOption(ctx context.Context, parameters map[string]string) (bool, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user