Skip to content

Commit

Permalink
fix(dbm-services): 错误匹配windows os name TencentBlueKing#6984
Browse files Browse the repository at this point in the history
  • Loading branch information
ymakedaq authored and iSecloud committed Sep 19, 2024
1 parent 9a155f7 commit f9efdce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dbm-services/common/db-resource/internal/svr/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ func (o *SearchContext) pickBase(db *gorm.DB) {
Value: "%" + strings.TrimSpace(strings.ToLower(osname)) + "%",
})
}
db.Clauses(clause.OrConditions{Exprs: conditions})
if len(conditions) == 1 {
db.Clauses(clause.AndConditions{Exprs: conditions})
} else {
// 有多个条件,使用or,才会被用()包括起来所有的or条件
db.Clauses(clause.OrConditions{Exprs: conditions})
}
}

// 如果没有指定资源类型,表示只能选择无资源类型标签的资源
Expand Down

0 comments on commit f9efdce

Please sign in to comment.