mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-18 04:10:22 +00:00
cleanup: standardize error format in NodeServer.NodeStageVolume()
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
cc3f146ad1
commit
65a10fd553
@ -182,7 +182,7 @@ func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol
|
|||||||
var imageAttributes *journal.ImageAttributes
|
var imageAttributes *journal.ImageAttributes
|
||||||
err = vi.DecomposeCSIID(volID)
|
err = vi.DecomposeCSIID(volID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = fmt.Errorf("error decoding volume ID (%s) (%s)", err, volID)
|
err = fmt.Errorf("error decoding volume ID (%s): %w", volID, err)
|
||||||
return nil, status.Error(codes.Internal, err.Error())
|
return nil, status.Error(codes.Internal, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol
|
|||||||
imageAttributes, err = j.GetImageAttributes(
|
imageAttributes, err = j.GetImageAttributes(
|
||||||
ctx, volOptions.Pool, vi.ObjectUUID, false)
|
ctx, volOptions.Pool, vi.ObjectUUID, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = fmt.Errorf("error fetching image attributes for volume ID (%s) (%s)", err, volID)
|
err = fmt.Errorf("error fetching image attributes for volume ID (%s): %w", volID, err)
|
||||||
return nil, status.Error(codes.Internal, err.Error())
|
return nil, status.Error(codes.Internal, err.Error())
|
||||||
}
|
}
|
||||||
volOptions.RbdImageName = imageAttributes.ImageName
|
volOptions.RbdImageName = imageAttributes.ImageName
|
||||||
|
Loading…
Reference in New Issue
Block a user