@@ -274,7 +274,7 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
274
274
275
275
// set different tmp-path with time info
276
276
tmpPath := fmt .Sprintf ("%s/%s#%d" , "/mnt" , volumeID , time .Now ().Unix ())
277
- args := fmt .Sprintf ("%s --tmp-path=%s --container-name=%s" , targetPath , tmpPath , containerName )
277
+ args := fmt .Sprintf ("%s --pre-mount-validate=true -- tmp-path=%s --container-name=%s" , targetPath , tmpPath , containerName )
278
278
for _ , opt := range mountOptions {
279
279
args = args + " " + opt
280
280
}
@@ -283,14 +283,23 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
283
283
targetPath , protocol , volumeID , attrib , mountFlags , mountOptions , args , serverAddress )
284
284
285
285
authEnv = append (authEnv , "AZURE_STORAGE_ACCOUNT=" + accountName , "AZURE_STORAGE_BLOB_ENDPOINT=" + serverAddress )
286
+ if d .enableBlobMockMount {
287
+ klog .Warningf ("NodeStageVolume: mock mount on volumeID(%s), this is only for TESTING!!!" , volumeID )
288
+ if err := volumehelper .MakeDir (targetPath ); err != nil {
289
+ klog .Errorf ("MakeDir failed on target: %s (%v)" , targetPath , err )
290
+ return nil , err
291
+ }
292
+ return & csi.NodeStageVolumeResponse {}, nil
293
+ }
294
+
286
295
var output string
287
296
if d .enableBlobfuseProxy {
288
297
output , err = d .mountBlobfuseWithProxy (args , authEnv )
289
298
} else {
290
299
output , err = d .mountBlobfuseInsideDriver (args , authEnv )
291
300
}
292
301
293
- if err != nil || strings . Contains ( string ( output ), "Unable to start blobfuse" ) {
302
+ if err != nil {
294
303
err = fmt .Errorf ("Mount failed with error: %v, output: %v" , err , output )
295
304
klog .Errorf ("%v" , err )
296
305
notMnt , mntErr := d .mounter .IsLikelyNotMountPoint (targetPath )
0 commit comments