Merge pull request #14947 from zexi/automated-cherry-pick-of-#14946-upstream-master

Automated cherry pick of #14946: fix(region): gpu_models in capabilities' response
This commit is contained in:
Zexi Li
2022-09-08 14:05:38 +08:00
committed by GitHub
+1
View File
@@ -743,6 +743,7 @@ func getGPUs(region *SCloudregion, zone *SZone, domainId string) []string {
hosts := hostQuery.SubQuery()
q := devices.Query(devices.Field("model"))
q = q.Startswith("dev_type", "GPU")
if region != nil {
subq := getRegionZoneSubq(region)
q = q.Join(hosts, sqlchemy.Equals(devices.Field("host_id"), hosts.Field("id")))