From d4480d4f327451c99a2f25e1aed7e17d848f3908 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Wed, 25 Jul 2018 19:27:24 +0530 Subject: [PATCH] Remove `auto_unmount` mount option from pv spec annotation to setup() func. At present, `auto_unmount` option is recorded at PV annotation of glusterfs PV. Due to the preference given in MountOptionFromSpec() for annotation mount options over sc supplied mount options(Ref PR# https://github.com/kubernetes/kubernetes/pull/66576), the sc supplied mount options are not honoured in glusterfs plugin eventhough the driver returns `true` for storage class mountoptions support at probe. This patch removes `auto_unmount` option from annotation of the pv spec. Signed-off-by: Humble Chirammal --- pkg/volume/glusterfs/glusterfs.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/volume/glusterfs/glusterfs.go b/pkg/volume/glusterfs/glusterfs.go index 59fb71c1a0e..3577e8f2151 100644 --- a/pkg/volume/glusterfs/glusterfs.go +++ b/pkg/volume/glusterfs/glusterfs.go @@ -322,7 +322,11 @@ func (b *glusterfsMounter) setUpAtInternal(dir string) error { } } + + //Add backup-volfile-servers and auto_unmount options. options = append(options, "backup-volfile-servers="+dstrings.Join(addrlist[:], ":")) + options = append(options, "auto_unmount") + mountOptions := volutil.JoinMountOptions(b.mountOptions, options) // with `backup-volfile-servers` mount option in place, it is not required to @@ -719,6 +723,7 @@ func (p *glusterfsVolumeProvisioner) Provision(selectedNode *v1.Node, allowedTop if len(pv.Spec.AccessModes) == 0 { pv.Spec.AccessModes = p.plugin.GetAccessModes() } + pv.Spec.MountOptions = p.options.MountOptions gidStr := strconv.FormatInt(int64(gid), 10) @@ -728,7 +733,6 @@ func (p *glusterfsVolumeProvisioner) Provision(selectedNode *v1.Node, allowedTop volutil.VolumeDynamicallyCreatedByKey: heketiAnn, glusterTypeAnn: "file", "Description": glusterDescAnn, - v1.MountOptionAnnotation: "auto_unmount", heketiVolIDAnn: volID, }