From 13a86d81767d607e5d9993116754c141bf3323d8 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Mon, 20 Nov 2017 10:38:14 +0530 Subject: [PATCH] Avoid wrong filling of glusterfs volume spec in ConstructVolumeSpec() Signed-off-by: Humble Chirammal --- pkg/volume/glusterfs/glusterfs.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pkg/volume/glusterfs/glusterfs.go b/pkg/volume/glusterfs/glusterfs.go index 300d19cdeb7..bf4c1c5fb3a 100644 --- a/pkg/volume/glusterfs/glusterfs.go +++ b/pkg/volume/glusterfs/glusterfs.go @@ -197,16 +197,11 @@ func (plugin *glusterfsPlugin) newUnmounterInternal(volName string, podUID types } func (plugin *glusterfsPlugin) ConstructVolumeSpec(volumeName, mountPath string) (*volume.Spec, error) { - glusterfsVolume := &v1.Volume{ - Name: volumeName, - VolumeSource: v1.VolumeSource{ - Glusterfs: &v1.GlusterfsVolumeSource{ - EndpointsName: volumeName, - Path: volumeName, - }, - }, - } - return volume.NewSpecFromVolume(glusterfsVolume), nil + + // To reconstrcut volume spec we need endpoint where fetching endpoint from mount + // string looks to be impossible, so returning error. + + return nil, fmt.Errorf("impossible to reconstruct glusterfs volume spec from volume mountpath") } // Glusterfs volumes represent a bare host file or directory mount of an Glusterfs export.