cleanup: rename csiID to driverInstance

The attribute and variable `csiID` ise used for at least two different
things:

 - name of the driver instance, used for journalling metadata
 - objects of the CSIIdentifier struct, composing a volume-handle

By changing the name of the `csiID` attribute for driver instances to
`driverInstance`, any confusion should be prevented.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
Niels de Vos
2025-01-24 13:42:52 +01:00
committed by mergify[bot]
parent af0a223edb
commit ecd15970de
5 changed files with 44 additions and 41 deletions

View File

@ -38,16 +38,19 @@ import (
type ReclaimSpaceControllerServer struct {
*rs.UnimplementedReclaimSpaceControllerServer
driver string
volumeLocks *util.VolumeLocks
driverInstance string
volumeLocks *util.VolumeLocks
}
// NewReclaimSpaceControllerServer creates a new ReclaimSpaceControllerServer which handles
// the ReclaimSpace Service requests from the CSI-Addons specification.
func NewReclaimSpaceControllerServer(driver string, volumeLocks *util.VolumeLocks) *ReclaimSpaceControllerServer {
func NewReclaimSpaceControllerServer(
driverInstance string,
volumeLocks *util.VolumeLocks,
) *ReclaimSpaceControllerServer {
return &ReclaimSpaceControllerServer{
driver: driver,
volumeLocks: volumeLocks,
driverInstance: driverInstance,
volumeLocks: volumeLocks,
}
}
@ -71,7 +74,7 @@ func (rscs *ReclaimSpaceControllerServer) ControllerReclaimSpace(
}
defer rscs.volumeLocks.Release(volumeID)
mgr := rbdutil.NewManager(rscs.driver, nil, req.GetSecrets())
mgr := rbdutil.NewManager(rscs.driverInstance, nil, req.GetSecrets())
defer mgr.Destroy(ctx)
rbdVol, err := mgr.GetVolumeByID(ctx, volumeID)