mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
csiaddons: use rbd.Manager
within ReclaimSpaceControllerServer
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
6560eee3d8
commit
af0a223edb
@ -17,6 +17,7 @@ limitations under the License.
|
||||
package rbd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
@ -25,7 +26,7 @@ import (
|
||||
// of the image.
|
||||
// This function will return ErrImageInUse if the image is in use, since
|
||||
// sparsifying an image on which i/o is in progress is not optimal.
|
||||
func (ri *rbdImage) Sparsify() error {
|
||||
func (ri *rbdImage) Sparsify(_ context.Context) error {
|
||||
inUse, err := ri.isInUse()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to check if image is in use: %w", err)
|
||||
|
@ -229,7 +229,7 @@ func (r *Driver) setupCSIAddonsServer(conf *util.Config) error {
|
||||
r.cas.RegisterService(is)
|
||||
|
||||
if conf.IsControllerServer {
|
||||
rs := casrbd.NewReclaimSpaceControllerServer(r.cs.VolumeLocks)
|
||||
rs := casrbd.NewReclaimSpaceControllerServer(conf.InstanceID, r.cs.VolumeLocks)
|
||||
r.cas.RegisterService(rs)
|
||||
|
||||
fcs := casrbd.NewFenceControllerServer()
|
||||
|
@ -45,6 +45,9 @@ type csiAddonsVolume interface {
|
||||
// RotateEncryptionKey processes the key rotation for the RBD Volume.
|
||||
RotateEncryptionKey(ctx context.Context) error
|
||||
|
||||
// Sparsify tries to free unused blocks of the volume from the CSI-Addons Controller.
|
||||
Sparsify(ctx context.Context) error
|
||||
|
||||
// HandleParentImageExistence checks the image's parent.
|
||||
// if the parent image does not exist and is not in trash, it returns nil.
|
||||
// if the flattenMode is FlattenModeForce, it flattens the image itself.
|
||||
|
Reference in New Issue
Block a user