rbd: pass CSI-instanceID to CSI-Addons VolumeGroupServer

Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
Niels de Vos 2024-07-17 10:08:27 +02:00 committed by mergify[bot]
parent 435e26d948
commit a98edab480
2 changed files with 8 additions and 3 deletions

View File

@ -37,12 +37,17 @@ type VolumeGroupServer struct {
// if volumegroup spec add more RPC services in the proto file, then we
// don't need to add all RPC methods leading to forward compatibility.
*volumegroup.UnimplementedControllerServer
// csiID is the unique ID for this CSI-driver deployment.
csiID string
}
// NewVolumeGroupServer creates a new VolumeGroupServer which handles the
// VolumeGroup Service requests from the CSI-Addons specification.
func NewVolumeGroupServer() *VolumeGroupServer {
return &VolumeGroupServer{}
func NewVolumeGroupServer(instanceID string) *VolumeGroupServer {
return &VolumeGroupServer{
csiID: instanceID,
}
}
func (vs *VolumeGroupServer) RegisterService(server grpc.ServiceRegistrar) {

View File

@ -222,7 +222,7 @@ func (r *Driver) setupCSIAddonsServer(conf *util.Config) error {
rcs := casrbd.NewReplicationServer(NewControllerServer(r.cd))
r.cas.RegisterService(rcs)
vgcs := casrbd.NewVolumeGroupServer()
vgcs := casrbd.NewVolumeGroupServer(conf.InstanceID)
r.cas.RegisterService(vgcs)
}