Merge pull request #65429 from WanLinghao/projected_error_return_fix

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix a return miss bug

**What this PR does / why we need it**:
This PR fix a return sentence miss bug
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
pull/8/head
Kubernetes Submit Queue 2018-07-16 13:52:54 -07:00 committed by GitHub
commit 2a0bc7af6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -354,13 +354,9 @@ func (c *projectedVolumeUnmounter) TearDownAt(dir string) error {
}
func getVolumeSource(spec *volume.Spec) (*v1.ProjectedVolumeSource, bool, error) {
var readOnly bool
var volumeSource *v1.ProjectedVolumeSource
if spec.Volume != nil && spec.Volume.Projected != nil {
volumeSource = spec.Volume.Projected
readOnly = spec.ReadOnly
return spec.Volume.Projected, spec.ReadOnly, nil
}
return volumeSource, readOnly, fmt.Errorf("Spec does not reference a projected volume type")
return nil, false, fmt.Errorf("Spec does not reference a projected volume type")
}