8000 Merge pull request #87499 from ejweber/fc-mount-options · kubernetes/kubernetes@c24fa74 · GitHub
[go: up one dir, main page]

Skip to content

Commit c24fa74

Browse files
authored
Merge pull request #87499 from ejweber/fc-mount-options
FC mount options
2 parents 4ea66a3 + adcdb2f commit c24fa74

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

pkg/volume/fc/attacher.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -217,20 +217,22 @@ func volumeSpecToMounter(spec *volume.Spec, host volume.VolumeHost) (*fcDiskMoun
217217
}
218218
klog.V(5).Infof("fc: volumeSpecToMounter volumeMode %s", volumeMode)
219219
return &fcDiskMounter{
220-
fcDisk: fcDisk,
221-
fsType: fc.FSType,
222-
volumeMode: volumeMode,
223-
readOnly: readOnly,
224-
mounter: volumeutil.NewSafeFormatAndMountFromHost(fcPluginName, host),
225-
deviceUtil: volumeutil.NewDeviceHandler(volumeutil.NewIOHandler()),
220+
fcDisk: fcDisk,
221+
fsType: fc.FSType,
222+
volumeMode: volumeMode,
223+
readOnly: readOnly,
224+
mounter: volumeutil.NewSafeFormatAndMountFromHost(fcPluginName, host),
225+
deviceUtil: volumeutil.NewDeviceHandler(volumeutil.NewIOHandler()),
226+
mountOptions: volumeutil.MountOptionFromSpec(spec),
226227
}, nil
227228
}
228229
return &fcDiskMounter{
229-
fcDisk: fcDisk,
230-
fsType: fc.FSType,
231-
readOnly: readOnly,
232-
mounter: volumeutil.NewSafeFormatAndMountFromHost(fcPluginName, host),
233-
deviceUtil: volumeutil.NewDeviceHandler(volumeutil.NewIOHandler()),
230+
fcDisk: fcDisk,
231+
fsType: fc.FSType,
232+
readOnly: readOnly,
233+
mounter: volumeutil.NewSafeFormatAndMountFromHost(fcPluginName, host),
234+
deviceUtil: volumeutil.NewDeviceHandler(volumeutil.NewIOHandler()),
235+
mountOptions: volumeutil.MountOptionFromSpec(spec),
234236
}, nil
235237
}
236238

pkg/volume/fc/fc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (plugin *fcPlugin) RequiresRemount() bool {
9393
}
9494

9595
func (plugin *fcPlugin) SupportsMountOption() bool {
96-
return false
96+
return true
9797
}
9898

9999
func (plugin *fcPlugin) SupportsBulkVolumeVerification() bool {
@@ -148,7 +148,7 @@ func (plugin *fcPlugin) newMounterInternal(spec *volume.Spec, podUID types.UID,
148148
readOnly: readOnly,
149149
mounter: &mount.SafeFormatAndMount{Interface: mounter, Exec: exec},
150150
deviceUtil: util.NewDeviceHandler(util.NewIOHandler()),
151-
mountOptions: []string{},
151+
mountOptions: util.MountOptionFromSpec(spec),
152152
}, nil
153153
}
154154
return &fcDiskMounter{

pkg/volume/fc/fc_util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func (util *fcUtil) AttachDisk(b fcDiskMounter) (string, error) {
268268
return devicePath, nil
269269
}
270270

271-
err = b.mounter.FormatAndMount(devicePath, globalPDPath, b.fsType, nil)
271+
err = b.mounter.FormatAndMount(devicePath, globalPDPath, b.fsType, b.mountOptions)
272272
if err != nil {
273273
return devicePath, fmt.Errorf("fc: failed to mount fc volume %s [%s] to %s, error %v", devicePath, b.fsType, globalPDPath, err)
274274
}

0 commit comments

Comments
 (0)
0