mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-01-17 18:29:30 +00:00
rbd: add struct to error
updating HandleParentImageExistence function to return more details error which includes the pool/namespace/image name Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
c773c98408
commit
e682f2cc73
@ -44,12 +44,12 @@ func (rv *rbdVolume) HandleParentImageExistence(
|
|||||||
// it is no longer required when the live image is flattened.
|
// it is no longer required when the live image is flattened.
|
||||||
err := rv.DeleteTempImage(ctx)
|
err := rv.DeleteTempImage(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to delete temporary rbd image: %w", err)
|
return fmt.Errorf("failed to delete temporary rbd image %s: %w", rv, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = rv.flattenRbdImage(ctx, true, 0, 0)
|
err = rv.flattenRbdImage(ctx, true, 0, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("failed to flatten image %s: %w", rv, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ func (rv *rbdVolume) HandleParentImageExistence(
|
|||||||
|
|
||||||
parent, err := rv.getParent()
|
parent, err := rv.getParent()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("failed to get parent of image %s: %w", rv, err)
|
||||||
}
|
}
|
||||||
parentMirroringInfo, err := parent.GetMirroringInfo()
|
parentMirroringInfo, err := parent.GetMirroringInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user