Avoid wrong filling of glusterfs volume spec in ConstructVolumeSpec()

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal
2017-11-20 10:38:14 +05:30
parent 26230218b8
commit 13a86d8176

View File

@@ -197,16 +197,11 @@ func (plugin *glusterfsPlugin) newUnmounterInternal(volName string, podUID types
} }
func (plugin *glusterfsPlugin) ConstructVolumeSpec(volumeName, mountPath string) (*volume.Spec, error) { func (plugin *glusterfsPlugin) ConstructVolumeSpec(volumeName, mountPath string) (*volume.Spec, error) {
glusterfsVolume := &v1.Volume{
Name: volumeName, // To reconstrcut volume spec we need endpoint where fetching endpoint from mount
VolumeSource: v1.VolumeSource{ // string looks to be impossible, so returning error.
Glusterfs: &v1.GlusterfsVolumeSource{
EndpointsName: volumeName, return nil, fmt.Errorf("impossible to reconstruct glusterfs volume spec from volume mountpath")
Path: volumeName,
},
},
}
return volume.NewSpecFromVolume(glusterfsVolume), nil
} }
// Glusterfs volumes represent a bare host file or directory mount of an Glusterfs export. // Glusterfs volumes represent a bare host file or directory mount of an Glusterfs export.