Skip to content

Commit b77a1d4

Browse files
author
sai chaithanya
authored
chore(mount): propagate mount errors to application pod events (#68)
return the root cause of mount issue along with status code. Signed-off-by: mittachaitu <[email protected]>
1 parent 57bfad6 commit b77a1d4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pkg/driver/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func (ns *node) NodePublishVolume(
159159
}
160160

161161
if err != nil {
162-
return nil, status.Error(codes.Internal, err.Error())
162+
return nil, err
163163
}
164164

165165
return &csi.NodePublishVolumeResponse{}, nil

pkg/lvm/mount.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,11 @@ func MountVolume(vol *apis.LVMVolume, mount *MountInfo, podLVInfo *PodLVInfo) er
198198

199199
err = FormatAndMountVol(devicePath, mount)
200200
if err != nil {
201-
return status.Error(codes.Internal, "not able to format and mount the volume")
201+
return status.Errorf(
202+
codes.Internal,
203+
"failed to format and mount the volume error: %s",
204+
err.Error(),
205+
)
202206
}
203207

204208
klog.Infof("lvm: volume %v mounted %v fs %v", volume, mount.MountPath, mount.FSType)

0 commit comments

Comments
 (0)