Merge pull request #76860 from SataQiu/fix-golint-volume-20190420

Fix golint failures of pkg/volume/local
This commit is contained in:
Kubernetes Prow Robot 2019-04-22 20:44:07 -07:00 committed by GitHub
commit b9606bef8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -347,7 +347,6 @@ pkg/volume/csi/fake
pkg/volume/git_repo pkg/volume/git_repo
pkg/volume/host_path pkg/volume/host_path
pkg/volume/iscsi pkg/volume/iscsi
pkg/volume/local
pkg/volume/nfs pkg/volume/nfs
pkg/volume/photon_pd pkg/volume/photon_pd
pkg/volume/portworx pkg/volume/portworx

View File

@ -42,7 +42,7 @@ const (
defaultFSType = "ext4" defaultFSType = "ext4"
) )
// This is the primary entrypoint for volume plugins. // ProbeVolumePlugins is the primary entrypoint for volume plugins.
func ProbeVolumePlugins() []volume.VolumePlugin { func ProbeVolumePlugins() []volume.VolumePlugin {
return []volume.VolumePlugin{&localVolumePlugin{}} return []volume.VolumePlugin{&localVolumePlugin{}}
} }
@ -587,15 +587,15 @@ func (u *localVolumeUnmapper) TearDownDevice(mapPath, _ string) error {
// GetGlobalMapPath returns global map path and error. // GetGlobalMapPath returns global map path and error.
// path: plugins/kubernetes.io/kubernetes.io/local-volume/volumeDevices/{volumeName} // path: plugins/kubernetes.io/kubernetes.io/local-volume/volumeDevices/{volumeName}
func (lv *localVolume) GetGlobalMapPath(spec *volume.Spec) (string, error) { func (l *localVolume) GetGlobalMapPath(spec *volume.Spec) (string, error) {
return filepath.Join(lv.plugin.host.GetVolumeDevicePluginDir(utilstrings.EscapeQualifiedName(localVolumePluginName)), return filepath.Join(l.plugin.host.GetVolumeDevicePluginDir(utilstrings.EscapeQualifiedName(localVolumePluginName)),
lv.volName), nil l.volName), nil
} }
// GetPodDeviceMapPath returns pod device map path and volume name. // GetPodDeviceMapPath returns pod device map path and volume name.
// path: pods/{podUid}/volumeDevices/kubernetes.io~local-volume // path: pods/{podUid}/volumeDevices/kubernetes.io~local-volume
// volName: local-pv-ff0d6d4 // volName: local-pv-ff0d6d4
func (lv *localVolume) GetPodDeviceMapPath() (string, string) { func (l *localVolume) GetPodDeviceMapPath() (string, string) {
return lv.plugin.host.GetPodVolumeDeviceDir(lv.podUID, return l.plugin.host.GetPodVolumeDeviceDir(l.podUID,
utilstrings.EscapeQualifiedName(localVolumePluginName)), lv.volName utilstrings.EscapeQualifiedName(localVolumePluginName)), l.volName
} }