mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: replace cli with go-ceph for snapshot namespace
cephcsi uses cli for fetching snap list as well as to check the snapshot namespace, replaced that with go-ceph calls. Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
06066cd153
commit
e1237f348f
@ -347,7 +347,7 @@ func flattenParentImage(ctx context.Context, rbdVol *rbdVolume, cr *util.Credent
|
||||
// If the snapshots are more than the `maxSnapshotsOnImage` Add a task to
|
||||
// flatten all the temporary cloned images.
|
||||
func flattenTemporaryClonedImages(ctx context.Context, rbdVol *rbdVolume, cr *util.Credentials) error {
|
||||
snaps, err := rbdVol.listSnapshots(ctx, cr)
|
||||
snaps, err := rbdVol.listSnapshots()
|
||||
if err != nil {
|
||||
if errors.Is(err, ErrImageNotFound) {
|
||||
return status.Error(codes.InvalidArgument, err.Error())
|
||||
@ -356,7 +356,13 @@ func flattenTemporaryClonedImages(ctx context.Context, rbdVol *rbdVolume, cr *ut
|
||||
}
|
||||
|
||||
if len(snaps) > int(maxSnapshotsOnImage) {
|
||||
err = flattenClonedRbdImages(ctx, snaps, rbdVol.Pool, rbdVol.Monitors, cr)
|
||||
err = flattenClonedRbdImages(
|
||||
ctx,
|
||||
snaps,
|
||||
rbdVol.Pool,
|
||||
rbdVol.Monitors,
|
||||
rbdVol.RbdImageName,
|
||||
cr)
|
||||
if err != nil {
|
||||
return status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
|
Reference in New Issue
Block a user