From 38106e7f0b5ae204bded1d4c0b022aba2971dd2d Mon Sep 17 00:00:00 2001 From: wenlxie Date: Sat, 12 May 2018 20:59:12 +0800 Subject: [PATCH] storageclass can be in annotation and spec --- pkg/scheduler/algorithm/predicates/predicates.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/scheduler/algorithm/predicates/predicates.go b/pkg/scheduler/algorithm/predicates/predicates.go index f1beb2394fc..1da525cd429 100644 --- a/pkg/scheduler/algorithm/predicates/predicates.go +++ b/pkg/scheduler/algorithm/predicates/predicates.go @@ -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)