mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-26 08:10:20 +00:00
rbd: check image not found error
during the checkSnapCloneExists we are checking the image, if the image not found we are deleting the snapshot on the parent image, This PR corrects the comparasion. instead of snapshotNotFound we need to check ImageNotFound error. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
953cfa508a
commit
4e82384b43
@ -151,8 +151,8 @@ func checkSnapCloneExists(ctx context.Context, parentVol *rbdVolume, rbdSnap *rb
|
|||||||
// Fetch on-disk image attributes
|
// Fetch on-disk image attributes
|
||||||
err = vol.getImageInfo()
|
err = vol.getImageInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
var esnf ErrSnapNotFound
|
var einf ErrImageNotFound
|
||||||
if errors.As(err, &esnf) {
|
if errors.As(err, &einf) {
|
||||||
err = parentVol.deleteSnapshot(ctx, rbdSnap)
|
err = parentVol.deleteSnapshot(ctx, rbdSnap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if _, ok := err.(ErrSnapNotFound); !ok {
|
if _, ok := err.(ErrSnapNotFound); !ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user