mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00:22 +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
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user