Allow absent Weight if PrioritizeVerb is empty

This commit is contained in:
Yang Guo
2017-10-19 14:07:59 -07:00
parent f07b359e5b
commit 1c60898bf5
2 changed files with 9 additions and 5 deletions

View File

@@ -36,7 +36,7 @@ func ValidatePolicy(policy schedulerapi.Policy) error {
binders := 0
for _, extender := range policy.ExtenderConfigs {
if extender.Weight <= 0 {
if len(extender.PrioritizeVerb) > 0 && extender.Weight <= 0 {
validationErrors = append(validationErrors, fmt.Errorf("Priority for extender %s should have a positive weight applied to it", extender.URLPrefix))
}
if extender.BindVerb != "" {