mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00: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>
(cherry picked from commit e15e2e5081
)
This commit is contained in:
parent
75fa1927fc
commit
38bd4e613e
@ -719,6 +719,13 @@ func (rv *rbdVolume) checkImageChainHasFeature(ctx context.Context, feature uint
|
||||
}
|
||||
err = vol.getImageInfo()
|
||||
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)
|
||||
return false, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user