mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 00:10:20 +00:00
rbd: Return current depth if the image is not found
If the image in the chain is moved to trash, we cannot get the image details. We need to return the found depth to the caller. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
76c2f3c109
commit
2c67ba1ec4
@ -408,6 +408,13 @@ func (rv *rbdVolume) getCloneDepth(ctx context.Context) (uint, error) {
|
||||
}
|
||||
err = vol.getImageInfo()
|
||||
if err != nil {
|
||||
// if the parent image is moved to trash the name will be present
|
||||
// in rbd image info but the image will be in trash, in that case
|
||||
// return the found depth
|
||||
var einf ErrImageNotFound
|
||||
if errors.As(err, &einf) {
|
||||
return depth, nil
|
||||
}
|
||||
klog.Errorf(util.Log(ctx, "failed to check depth on image %s: %s"), vol, err)
|
||||
return depth, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user