Merge pull request #49707 from jianglingxia/jlx72717

Automatic merge from submit-queue (batch tested with PRs 49651, 49707, 49662, 47019, 49747)

remove the redundant err define

**What this PR does / why we need it**:
some place has define err  ,like 
class, err := volutil.GetClassForVolume(d.plugin.host.GetKubeClient(), d.spec)
so delete the err define!
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-07-31 16:56:53 -07:00 committed by GitHub
commit 2e519c73ff

View File

@ -542,13 +542,12 @@ func (plugin *glusterfsPlugin) collectGids(className string, gidTable *MinMaxAll
// - Adapt the range of the table to the current range of the SC. // - Adapt the range of the table to the current range of the SC.
// //
func (plugin *glusterfsPlugin) getGidTable(className string, min int, max int) (*MinMaxAllocator, error) { func (plugin *glusterfsPlugin) getGidTable(className string, min int, max int) (*MinMaxAllocator, error) {
var err error
plugin.gidTableLock.Lock() plugin.gidTableLock.Lock()
gidTable, ok := plugin.gidTable[className] gidTable, ok := plugin.gidTable[className]
plugin.gidTableLock.Unlock() plugin.gidTableLock.Unlock()
if ok { if ok {
err = gidTable.SetRange(min, max) err := gidTable.SetRange(min, max)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -607,7 +606,6 @@ func (d *glusterfsVolumeDeleter) getGid() (int, bool, error) {
} }
func (d *glusterfsVolumeDeleter) Delete() error { func (d *glusterfsVolumeDeleter) Delete() error {
var err error
glog.V(2).Infof("glusterfs: delete volume: %s ", d.glusterfsMounter.path) glog.V(2).Infof("glusterfs: delete volume: %s ", d.glusterfsMounter.path)
volumeName := d.glusterfsMounter.path volumeName := d.glusterfsMounter.path
volumeID := dstrings.TrimPrefix(volumeName, volPrefix) volumeID := dstrings.TrimPrefix(volumeName, volPrefix)
@ -681,7 +679,6 @@ func (p *glusterfsVolumeProvisioner) Provision() (*v1.PersistentVolume, error) {
return nil, fmt.Errorf("invalid AccessModes %v: only AccessModes %v are supported", p.options.PVC.Spec.AccessModes, p.plugin.GetAccessModes()) return nil, fmt.Errorf("invalid AccessModes %v: only AccessModes %v are supported", p.options.PVC.Spec.AccessModes, p.plugin.GetAccessModes())
} }
var err error
if p.options.PVC.Spec.Selector != nil { if p.options.PVC.Spec.Selector != nil {
glog.V(4).Infof("glusterfs: not able to parse your claim Selector") glog.V(4).Infof("glusterfs: not able to parse your claim Selector")
return nil, fmt.Errorf("glusterfs: not able to parse your claim Selector") return nil, fmt.Errorf("glusterfs: not able to parse your claim Selector")
@ -921,7 +918,6 @@ func getClusterNodes(cli *gcli.Client, cluster string) (dynamicHostIps []string,
func parseClassParameters(params map[string]string, kubeClient clientset.Interface) (*provisionerConfig, error) { func parseClassParameters(params map[string]string, kubeClient clientset.Interface) (*provisionerConfig, error) {
var cfg provisionerConfig var cfg provisionerConfig
var err error var err error
cfg.gidMin = defaultGidMin cfg.gidMin = defaultGidMin
cfg.gidMax = defaultGidMax cfg.gidMax = defaultGidMax