@@ -70,6 +70,7 @@ type csiClient interface {
70
70
accessMode api.PersistentVolumeAccessMode ,
71
71
secrets map [string ]string ,
72
72
volumeContext map [string ]string ,
73
+ mountOptions []string ,
73
74
) error
74
75
75
76
NodeGetVolumeStats (
@@ -507,6 +508,7 @@ func (c *csiDriverClient) NodeStageVolume(ctx context.Context,
507
508
accessMode api.PersistentVolumeAccessMode ,
508
509
secrets map [string ]string ,
509
510
volumeContext map [string ]string ,
511
+ mountOptions []string ,
510
512
) error {
511
513
klog .V (4 ).Info (log ("calling NodeStageVolume rpc [volid=%s,staging_target_path=%s]" , volID , stagingTargetPath ))
512
514
if volID == "" {
@@ -517,9 +519,9 @@ func (c *csiDriverClient) NodeStageVolume(ctx context.Context,
517
519
}
518
520
519
521
if c .nodeV1ClientCreator != nil {
520
- return c .nodeStageVolumeV1 (ctx , volID , publishContext , stagingTargetPath , fsType , accessMode , secrets , volumeContext )
522
+ return c .nodeStageVolumeV1 (ctx , volID , publishContext , stagingTargetPath , fsType , accessMode , secrets , volumeContext , mountOptions )
521
523
} else if c .nodeV0ClientCreator != nil {
522
- return c .nodeStageVolumeV0 (ctx , volID , publishContext , stagingTargetPath , fsType , accessMode , secrets , volumeContext )
524
+ return c .nodeStageVolumeV0 (ctx , volID , publishContext , stagingTargetPath , fsType , accessMode , secrets , volumeContext , mountOptions )
523
525
}
524
526
525
527
return fmt .Errorf ("failed to call NodeStageVolume. Both nodeV1ClientCreator and nodeV0ClientCreator are nil" )
@@ -534,6 +536,7 @@ func (c *csiDriverClient) nodeStageVolumeV1(
534
536
accessMode api.PersistentVolumeAccessMode ,
535
537
secrets map [string ]string ,
536
538
volumeContext map [string ]string ,
539
+ mountOptions []string ,
537
540
) error {
538
541
nodeClient , closer , err := c .nodeV1ClientCreator (c .addr )
539
542
if err != nil {
@@ -561,7 +564,8 @@ func (c *csiDriverClient) nodeStageVolumeV1(
561
564
} else {
562
565
req .VolumeCapability .AccessType = & csipbv1.VolumeCapability_Mount {
563
566
Mount : & csipbv1.VolumeCapability_MountVolume {
564
- FsType : fsType ,
567
+ FsType : fsType ,
568
+ MountFlags : mountOptions ,
565
569
},
566
570
}
567
571
}
@@ -579,6 +583,7 @@ func (c *csiDriverClient) nodeStageVolumeV0(
579
583
accessMode api.PersistentVolumeAccessMode ,
580
584
secrets map [string ]string ,
581
585
volumeContext map [string ]string ,
586
+ mountOptions []string ,
582
587
) error {
583
588
nodeClient , closer , err := c .nodeV0ClientCreator (c .addr )
584
589
if err != nil {
@@ -606,7 +611,8 @@ func (c *csiDriverClient) nodeStageVolumeV0(
606
611
} else {
607
612
req .VolumeCapability .AccessType = & csipbv0.VolumeCapability_Mount {
608
613
Mount : & csipbv0.VolumeCapability_MountVolume {
609
- FsType : fsType ,
614
+ FsType : fsType ,
615
+ MountFlags : mountOptions ,
610
616
},
611
617
}
612
618
}
0 commit comments