mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-25 14:30:22 +00:00
rbd: discard image not found error
For flatten we call checkImageChainHasFeature which internally calls to getImageInfo returns the parent name even if the parent is in the trash, when we try to open the parent image to get its information it fails as the image not found. we should treat error as nil if the parent is not found. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
86cfc3dd0c
commit
e15e2e5081
@ -719,6 +719,13 @@ func (rv *rbdVolume) checkImageChainHasFeature(ctx context.Context, feature uint
|
|||||||
}
|
}
|
||||||
err = vol.getImageInfo()
|
err = vol.getImageInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// call to getImageInfo returns the parent name even if the parent
|
||||||
|
// is in the trash, when we try to open the parent image to get its
|
||||||
|
// information it fails because it is already in trash. We should
|
||||||
|
// treat error as nil if the parent is not found.
|
||||||
|
if errors.Is(err, ErrImageNotFound) {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
util.ErrorLog(ctx, "failed to get image info for %s: %s", vol, err)
|
util.ErrorLog(ctx, "failed to get image info for %s: %s", vol, err)
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user