Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GlusterFS: Move GetVolumeName() to unimplemented func. #70860

Merged
merged 1 commit into from
Nov 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 1 addition & 24 deletions pkg/volume/glusterfs/glusterfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,30 +106,7 @@ func (plugin *glusterfsPlugin) GetPluginName() string {
}

func (plugin *glusterfsPlugin) GetVolumeName(spec *volume.Spec) (string, error) {
var endpointName string
var endpointsNsPtr *string

volPath, _, err := getVolumeInfo(spec)
if err != nil {
return "", err
}

if spec.Volume != nil && spec.Volume.Glusterfs != nil {
endpointName = spec.Volume.Glusterfs.EndpointsName
} else if spec.PersistentVolume != nil &&
spec.PersistentVolume.Spec.Glusterfs != nil {
endpointName = spec.PersistentVolume.Spec.Glusterfs.EndpointsName
endpointsNsPtr = spec.PersistentVolume.Spec.Glusterfs.EndpointsNamespace
if endpointsNsPtr != nil && *endpointsNsPtr != "" {
return fmt.Sprintf("%v:%v:%v", endpointName, *endpointsNsPtr, volPath), nil
}
return "", fmt.Errorf("invalid endpointsnamespace in provided glusterfs PV spec")

} else {
return "", fmt.Errorf("unable to fetch required parameters from provided glusterfs spec")
}

return fmt.Sprintf("%v:%v", endpointName, volPath), nil
return "", fmt.Errorf("GetVolumeName() is unimplemented for GlusterFS")
}

func (plugin *glusterfsPlugin) CanSupport(spec *volume.Spec) bool {
Expand Down