mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #6347 from zexi/hotfix/scheduler-schedtag-empty-strategy
scheduler: set schedtag default strategy if input empty
This commit is contained in:
@@ -123,6 +123,16 @@ func GetRequestSchedtags(reqTags []*computeapi.SchedtagConfig, allTags []models.
|
||||
|
||||
appendedTagIds := make(map[string]int)
|
||||
|
||||
for _, reqTag := range reqTags {
|
||||
for _, dbTag := range allTags {
|
||||
if reqTag.Id == dbTag.Id || reqTag.Id == dbTag.Name {
|
||||
if reqTag.Strategy == "" {
|
||||
reqTag.Strategy = dbTag.DefaultStrategy
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
appendTagByStrategy := func(tag *computeapi.SchedtagConfig, defaultWeight int) {
|
||||
if tag.Weight <= 0 {
|
||||
tag.Weight = defaultWeight
|
||||
|
||||
Reference in New Issue
Block a user