Merge pull request #64383 from andyzhangx/azurefile-sizegrow-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 azure file size grow issue

**What this PR does / why we need it**:
fix azure file size grow issue

**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 #64382

**Special notes for your reviewer**:

**Release note**:

```
fix azure file size grow issue
```

/sig azure
/assign @feiskyer
pull/8/head
Kubernetes Submit Queue 2018-05-28 05:23:59 -07:00 committed by GitHub
commit cf27c256ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ func (plugin *azureFilePlugin) ExpandVolumeDevice(
newSize resource.Quantity,
oldSize resource.Quantity) (resource.Quantity, error) {
if spec.PersistentVolume != nil || spec.PersistentVolume.Spec.AzureFile == nil {
if spec.PersistentVolume == nil || spec.PersistentVolume.Spec.AzureFile == nil {
return oldSize, fmt.Errorf("invalid PV spec")
}
shareName := spec.PersistentVolume.Spec.AzureFile.ShareName