From 54b66e8b5d13e317d4182c9e2901e8391cc87ccd Mon Sep 17 00:00:00 2001 From: whitewindmills Date: Thu, 24 Aug 2023 19:05:59 +0800 Subject: [PATCH] adapt zones check in spread constraint plugin check Signed-off-by: whitewindmills --- .../framework/plugins/spreadconstraint/spread_constraint.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/scheduler/framework/plugins/spreadconstraint/spread_constraint.go b/pkg/scheduler/framework/plugins/spreadconstraint/spread_constraint.go index 8d9c45cfe..12a64e72d 100644 --- a/pkg/scheduler/framework/plugins/spreadconstraint/spread_constraint.go +++ b/pkg/scheduler/framework/plugins/spreadconstraint/spread_constraint.go @@ -41,8 +41,8 @@ func (p *SpreadConstraint) Filter( return framework.NewResult(framework.Unschedulable, "cluster(s) did not have provider property") } else if spreadConstraint.SpreadByField == policyv1alpha1.SpreadByFieldRegion && cluster.Spec.Region == "" { return framework.NewResult(framework.Unschedulable, "cluster(s) did not have region property") - } else if spreadConstraint.SpreadByField == policyv1alpha1.SpreadByFieldZone && cluster.Spec.Zone == "" { - return framework.NewResult(framework.Unschedulable, "cluster(s) did not have zone property") + } else if spreadConstraint.SpreadByField == policyv1alpha1.SpreadByFieldZone && len(cluster.Spec.Zones) == 0 { + return framework.NewResult(framework.Unschedulable, "cluster(s) did not have zones property") } }