Merge pull request #38261 from tanshanshan/more-readable

Automatic merge from submit-queue (batch tested with PRs 37701, 36702, 37145, 37424, 38261)

replace err with nil when err is nil

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:

When err is nil ,replace err with nil, that can make code more readable

Thanks.
**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
pull/6/head
Kubernetes Submit Queue 2016-12-08 04:39:26 -08:00 committed by GitHub
commit ae1a7784af
2 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ func CloudProviders() []string {
} }
// GetCloudProvider creates an instance of the named cloud provider, or nil if // GetCloudProvider creates an instance of the named cloud provider, or nil if
// the name is not known. The error return is only used if the named provider // the name is unknown. The error return is only used if the named provider
// was known but failed to initialize. The config parameter specifies the // was known but failed to initialize. The config parameter specifies the
// io.Reader handler of the configuration file for the cloud provider, or nil // io.Reader handler of the configuration file for the cloud provider, or nil
// for no configuation. // for no configuation.

View File

@ -124,7 +124,7 @@ func (l *persistentVolumeLabel) findAWSEBSLabels(volume *api.PersistentVolume) (
return nil, err return nil, err
} }
return labels, err return labels, nil
} }
// getEBSVolumes returns the AWS Volumes interface for ebs // getEBSVolumes returns the AWS Volumes interface for ebs
@ -169,7 +169,7 @@ func (l *persistentVolumeLabel) findGCEPDLabels(volume *api.PersistentVolume) (m
return nil, err return nil, err
} }
return labels, err return labels, nil
} }
// getGCECloudProvider returns the GCE cloud provider, for use for querying volume labels // getGCECloudProvider returns the GCE cloud provider, for use for querying volume labels