Skip to content

Commit ead0083

Browse files
authored
Merge pull request #258 from andyzhangx/nfs-permission
fix: NFSv3 permission issue with non-root user
2 parents 00cfe15 + ba2eeb2 commit ead0083

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/blob/nodeserver.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
153153
}); err != nil {
154154
return nil, status.Error(codes.Internal, fmt.Sprintf("volume(%s) mount %q on %q failed with %v", volumeID, source, targetPath, err))
155155
}
156+
157+
// set 0777 for NFSv3 root folder
158+
if err := os.Chmod(targetPath, 0777); err != nil {
159+
return nil, status.Error(codes.Internal, fmt.Sprintf("Chmod(%s) failed with %v", targetPath, err))
160+
}
156161
klog.V(2).Infof("volume(%s) mount %q on %q succeeded", volumeID, source, targetPath)
157162

158163
return &csi.NodeStageVolumeResponse{}, nil

0 commit comments

Comments
 (0)