Merge pull request #63749 from wenlxie/githubupstream.master.minofixforgetstorageclass

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

minor fix for VolumeZoneChecker predicate 

storageclass can be in annotation and spec.

```release-note
minor fix for VolumeZoneChecker predicate, storageclass can be in annotation and spec.
```
This commit is contained in:
Kubernetes Submit Queue 2018-05-17 05:51:05 -07:00 committed by GitHub
commit 9a15ee7035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -592,9 +592,9 @@ func (c *VolumeZoneChecker) predicate(pod *v1.Pod, meta algorithm.PredicateMetad
pvName := pvc.Spec.VolumeName
if pvName == "" {
if utilfeature.DefaultFeatureGate.Enabled(features.VolumeScheduling) {
scName := pvc.Spec.StorageClassName
if scName != nil && len(*scName) > 0 {
class, _ := c.classInfo.GetStorageClassInfo(*scName)
scName := v1helper.GetPersistentVolumeClaimClass(pvc)
if len(scName) > 0 {
class, _ := c.classInfo.GetStorageClassInfo(scName)
if class != nil {
if class.VolumeBindingMode == nil {
return false, nil, fmt.Errorf("VolumeBindingMode not set for StorageClass %q", scName)