From 4e82384b43478b4f034b41e90760ed1a9d962166 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 7 Jul 2020 12:49:05 +0530 Subject: [PATCH] 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 --- internal/rbd/rbd_journal.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/rbd/rbd_journal.go b/internal/rbd/rbd_journal.go index fcc55ca2a..8852cbc80 100644 --- a/internal/rbd/rbd_journal.go +++ b/internal/rbd/rbd_journal.go @@ -151,8 +151,8 @@ func checkSnapCloneExists(ctx context.Context, parentVol *rbdVolume, rbdSnap *rb // Fetch on-disk image attributes err = vol.getImageInfo() if err != nil { - var esnf ErrSnapNotFound - if errors.As(err, &esnf) { + var einf ErrImageNotFound + if errors.As(err, &einf) { err = parentVol.deleteSnapshot(ctx, rbdSnap) if err != nil { if _, ok := err.(ErrSnapNotFound); !ok {