Merge pull request #8155 from tb365/automated-cherry-pick-of-#8154-upstream-release-3.2

Automated cherry pick of #8154: aliyun public elb brand fix
This commit is contained in:
yunion-ci-robot
2020-09-29 18:18:34 +08:00
committed by GitHub
2 changed files with 8 additions and 0 deletions
+3
View File
@@ -202,6 +202,9 @@ type LoadbalancerResourceInfo struct {
ZoneId string `json:"zone_id"`
ZoneResourceInfoBase
// cloud provider info
ManagedResourceInfo
}
type LoadbalancerResourceInput struct {
@@ -167,23 +167,28 @@ func (manager *SLoadbalancerResourceBaseManager) FetchCustomizeColumns(
vpcList := make([]interface{}, len(rows))
zoneList := make([]interface{}, len(rows))
manList := make([]interface{}, len(rows))
for i := range rows {
rows[i] = api.LoadbalancerResourceInfo{}
if lb, ok := lbs[lbIds[i]]; ok {
rows[i].Loadbalancer = lb.Name
rows[i].VpcId = lb.VpcId
rows[i].ZoneId = lb.ZoneId
rows[i].ManagerId = lb.ManagerId
}
vpcList[i] = &SVpcResourceBase{rows[i].VpcId}
zoneList[i] = &SZoneResourceBase{rows[i].ZoneId}
manList[i] = &SManagedResourceBase{rows[i].ManagerId}
}
vpcRows := manager.SVpcResourceBaseManager.FetchCustomizeColumns(ctx, userCred, query, vpcList, fields, isList)
zoneRows := manager.SZoneResourceBaseManager.FetchCustomizeColumns(ctx, userCred, query, zoneList, fields, isList)
manRows := manager.SManagedResourceBaseManager.FetchCustomizeColumns(ctx, userCred, query, manList, fields, isList)
for i := range rows {
rows[i].VpcResourceInfo = vpcRows[i]
rows[i].ZoneResourceInfoBase = zoneRows[i].ZoneResourceInfoBase
rows[i].ManagedResourceInfo = manRows[i]
}
return rows
}