Merge pull request #55796 from humblec/construct

Automatic merge from submit-queue (batch tested with PRs 55938, 56055, 53385, 55796, 55922). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Avoid wrong filling of  glusterfs Volume Spec at ConstructVolumeSpec()

Issue#https://github.com/kubernetes/kubernetes/issues/37625, https://github.com/kubernetes/kubernetes/issues/49108

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Kubernetes Submit Queue 2017-11-21 07:43:48 -08:00 committed by GitHub
commit 8440a50990
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.