Merge pull request #57091 from humblec/volume-mode

Automatic merge from submit-queue (batch tested with PRs 57148, 57123, 57091, 57141, 57131). 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>.

Add VolumeMode in GlusterFS PV spec.

This ensures that GlusterFS pvs are file backed storage.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>



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

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

```
This commit is contained in:
Kubernetes Submit Queue 2017-12-16 21:00:46 -08:00 committed by GitHub
commit a28e708ec6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -704,10 +704,12 @@ func (p *glusterfsVolumeProvisioner) Provision() (*v1.PersistentVolume, error) {
glog.Errorf("create volume error: %v.", err)
return nil, fmt.Errorf("create volume error: %v", err)
}
mode := v1.PersistentVolumeFilesystem
pv := new(v1.PersistentVolume)
pv.Spec.PersistentVolumeSource.Glusterfs = glusterfs
pv.Spec.PersistentVolumeReclaimPolicy = p.options.PersistentVolumeReclaimPolicy
pv.Spec.AccessModes = p.options.PVC.Spec.AccessModes
pv.Spec.VolumeMode = &mode
if len(pv.Spec.AccessModes) == 0 {
pv.Spec.AccessModes = p.plugin.GetAccessModes()
}