@@ -220,8 +220,8 @@ func (cs *ControllerServer) internalMount(ctx context.Context, vol *nfsVolume) e
220
220
_ , err := cs .Driver .ns .NodePublishVolume (ctx , & csi.NodePublishVolumeRequest {
221
221
TargetPath : targetPath ,
222
222
VolumeContext : map [string ]string {
223
- "server" : vol .server ,
224
- "share" : sharePath ,
223
+ paramServer : vol .server ,
224
+ attrShare : sharePath ,
225
225
},
226
226
VolumeCapability : & stdVolCap ,
227
227
VolumeId : vol .id ,
@@ -281,6 +281,10 @@ func (cs *ControllerServer) newNFSVolume(name string, params map[string]string)
281
281
282
282
// Get working directory for CreateVolume and DeleteVolume
283
283
func (cs * ControllerServer ) getInternalMountPath (vol * nfsVolume ) string {
284
+ // use default if empty
285
+ if cs .workingMountDir == "" {
286
+ cs .workingMountDir = "/mnt"
287
+ }
284
288
return filepath .Join (cs .workingMountDir , vol .subDir )
285
289
}
286
290
@@ -312,21 +316,6 @@ func (cs *ControllerServer) nfsVolToCSI(vol *nfsVolume, reqBytes int64) *csi.Vol
312
316
}
313
317
}
314
318
315
- // Given a CSI volume id, return a nfsVolume
316
- func (cs * ControllerServer ) getNfsVolFromId (id string ) (* nfsVolume , error ) {
317
- tokens := strings .Split (id , "/" )
318
- if len (tokens ) != totalIDElements {
319
- return nil , fmt .Errorf ("volume id %q unexpected format: got %v tokens" , id , len (tokens ))
320
- }
321
-
322
- return & nfsVolume {
323
- id : id ,
324
- server : tokens [idServer ],
325
- baseDir : tokens [idBaseDir ],
326
- subDir : tokens [idSubDir ],
327
- }, nil
328
- }
329
-
330
319
// Given a nfsVolume, return a CSI volume id
331
320
func (cs * ControllerServer ) getVolumeIdFromNfsVol (vol * nfsVolume ) string {
332
321
idElements := make ([]string , totalIDElements )
0 commit comments