Skip to content

Commit

Permalink
Merge pull request kubernetes#41906 from gnufied/implement-mount-options
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Implement support for mount options in PVs

**What this PR does / why we need it**:

This PR implements support for mount options in PersistentVolume via `volume.beta.kubernetes.io/mount-options` annotation.

**Which issue this PR fixes** 

Fixes kubernetes/enhancements#168

**Release note**:
```
Enable additional, custom mount options to be passed to PersistentVolume objects via volume.beta.kubernetes.io/mount-options annotation.
```
  • Loading branch information
Kubernetes Submit Queue committed Mar 1, 2017
2 parents d8b5437 + 3984970 commit dd2306a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/volume/cinder/attacher.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ func (attacher *cinderDiskAttacher) MountDevice(spec *volume.Spec, devicePath st
}
if notMnt {
diskMounter := &mount.SafeFormatAndMount{Interface: mounter, Runner: exec.New()}
err = diskMounter.FormatAndMount(devicePath, deviceMountPath, volumeSource.FSType, options)
mountOptions := volume.MountOptionFromSpec(spec, options...)
err = diskMounter.FormatAndMount(devicePath, deviceMountPath, volumeSource.FSType, mountOptions)
if err != nil {
os.Remove(deviceMountPath)
return err
Expand Down
4 changes: 4 additions & 0 deletions pkg/volume/cinder/cinder.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ func (plugin *cinderPlugin) RequiresRemount() bool {
return false
}

func (plugin *cinderPlugin) SupportsMountOption() bool {
return true
}

func (plugin *cinderPlugin) GetAccessModes() []v1.PersistentVolumeAccessMode {
return []v1.PersistentVolumeAccessMode{
v1.ReadWriteOnce,
Expand Down

0 comments on commit dd2306a

Please sign in to comment.