mirror of https://github.com/k3s-io/k3s
GetVolumeName() is used in a few places, all of which are not applicable to gluster:
AD controller kubelet volume manager actual/desired sw for attachable volumes volume reconstruction This is a followup PR based on comment# https://github.com/kubernetes/kubernetes/pull/60195#discussion_r231675596 Signed-off-by: Humble Chirammal <hchiramm@redhat.com>pull/564/head
parent
8825843126
commit
e9ed21988d
|
@ -106,30 +106,7 @@ func (plugin *glusterfsPlugin) GetPluginName() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *glusterfsPlugin) GetVolumeName(spec *volume.Spec) (string, error) {
|
func (plugin *glusterfsPlugin) GetVolumeName(spec *volume.Spec) (string, error) {
|
||||||
var endpointName string
|
return "", fmt.Errorf("GetVolumeName() is unimplemented for GlusterFS")
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *glusterfsPlugin) CanSupport(spec *volume.Spec) bool {
|
func (plugin *glusterfsPlugin) CanSupport(spec *volume.Spec) bool {
|
||||||
|
|
Loading…
Reference in New Issue