From 3984970d53a3338e62dafe70ae0333c41f81e5c2 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Tue, 21 Feb 2017 13:19:48 -0500 Subject: [PATCH] Implement support for mount options in PVs Add support for mount options via annotations on PVs --- pkg/volume/cinder/attacher.go | 3 ++- pkg/volume/cinder/cinder.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/volume/cinder/attacher.go b/pkg/volume/cinder/attacher.go index fe466c4d6542f..ad9aa50becd5b 100644 --- a/pkg/volume/cinder/attacher.go +++ b/pkg/volume/cinder/attacher.go @@ -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 diff --git a/pkg/volume/cinder/cinder.go b/pkg/volume/cinder/cinder.go index e8b10cd35976f..8e3067496d8f6 100644 --- a/pkg/volume/cinder/cinder.go +++ b/pkg/volume/cinder/cinder.go @@ -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,