Unverified Commit d80614d4 authored by k8s-ci-robot's avatar k8s-ci-robot Committed by GitHub

Merge pull request #70860 from humblec/getVolumeName

GlusterFS: Move GetVolumeName() to unimplemented func.
parents 6d189fd3 e9ed2198
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment