Commit 38106e7f authored by wenlxie's avatar wenlxie

storageclass can be in annotation and spec

parent feeee503
...@@ -592,9 +592,9 @@ func (c *VolumeZoneChecker) predicate(pod *v1.Pod, meta algorithm.PredicateMetad ...@@ -592,9 +592,9 @@ func (c *VolumeZoneChecker) predicate(pod *v1.Pod, meta algorithm.PredicateMetad
pvName := pvc.Spec.VolumeName pvName := pvc.Spec.VolumeName
if pvName == "" { if pvName == "" {
if utilfeature.DefaultFeatureGate.Enabled(features.VolumeScheduling) { if utilfeature.DefaultFeatureGate.Enabled(features.VolumeScheduling) {
scName := pvc.Spec.StorageClassName scName := v1helper.GetPersistentVolumeClaimClass(pvc)
if scName != nil && len(*scName) > 0 { if len(scName) > 0 {
class, _ := c.classInfo.GetStorageClassInfo(*scName) class, _ := c.classInfo.GetStorageClassInfo(scName)
if class != nil { if class != nil {
if class.VolumeBindingMode == nil { if class.VolumeBindingMode == nil {
return false, nil, fmt.Errorf("VolumeBindingMode not set for StorageClass %q", scName) return false, nil, fmt.Errorf("VolumeBindingMode not set for StorageClass %q", scName)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment