Implement support for mount options in PVs

Add support for mount options via annotations on PVs
This commit is contained in:
Hemant Kumar
2017-02-21 13:19:48 -05:00
parent 2249550b57
commit 2d3008fc56
45 changed files with 544 additions and 69 deletions

View File

@@ -86,6 +86,10 @@ func (plugin *rbdPlugin) RequiresRemount() bool {
return false
}
func (plugin *rbdPlugin) SupportsMountOption() bool {
return true
}
func (plugin *rbdPlugin) GetAccessModes() []v1.PersistentVolumeAccessMode {
return []v1.PersistentVolumeAccessMode{
v1.ReadWriteOnce,
@@ -136,11 +140,12 @@ func (plugin *rbdPlugin) newMounterInternal(spec *volume.Spec, podUID types.UID,
mounter: &mount.SafeFormatAndMount{Interface: mounter, Runner: exec.New()},
plugin: plugin,
},
Mon: source.CephMonitors,
Id: id,
Keyring: keyring,
Secret: secret,
fsType: source.FSType,
Mon: source.CephMonitors,
Id: id,
Keyring: keyring,
Secret: secret,
fsType: source.FSType,
mountOptions: volume.MountOptionFromSpec(spec),
}, nil
}
@@ -360,13 +365,14 @@ func (rbd *rbd) GetPath() string {
type rbdMounter struct {
*rbd
// capitalized so they can be exported in persistRBD()
Mon []string
Id string
Keyring string
Secret string
fsType string
adminSecret string
adminId string
Mon []string
Id string
Keyring string
Secret string
fsType string
adminSecret string
adminId string
mountOptions []string
}
var _ volume.Mounter = &rbdMounter{}