adapt zones check in spread constraint plugin

check

Signed-off-by: whitewindmills <jayfantasyhjh@gmail.com>
This commit is contained in:
whitewindmills 2023-08-24 19:05:59 +08:00
parent 5e8a765fe0
commit 54b66e8b5d
1 changed files with 2 additions and 2 deletions

View File

@ -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")
}
}