mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-26 08:10:20 +00:00
cephfs: Add isCloneRetryError function
The function isCloneRetryError verifies if the clone error is `pending` or `in-progress` error. Co-authored-by: Madhu Rajanna <madhupr007@gmail.com> Signed-off-by: Yug <yuggupta27@gmail.com>
This commit is contained in:
parent
acbedc52bf
commit
3ac6bbd87c
@ -155,6 +155,12 @@ func cleanupCloneFromSubvolumeSnapshot(ctx context.Context, volID, cloneID volum
|
||||
return nil
|
||||
}
|
||||
|
||||
// isCloneRetryError returns true if the clone error is pending,in-progress
|
||||
// error.
|
||||
func isCloneRetryError(err error) bool {
|
||||
return errors.Is(err, ErrCloneInProgress) || errors.Is(err, ErrClonePending)
|
||||
}
|
||||
|
||||
func createCloneFromSnapshot(ctx context.Context, parentVolOpt, volOptions *volumeOptions, vID *volumeIdentifier, sID *snapshotIdentifier, cr *util.Credentials) error {
|
||||
snapID := volumeID(sID.FsSnapshotName)
|
||||
err := cloneSnapshot(ctx, parentVolOpt, cr, volumeID(sID.FsSubvolName), snapID, volumeID(vID.FsSubvolName), volOptions)
|
||||
|
Loading…
Reference in New Issue
Block a user