mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #14330 from ioito/hotfix/qx-huawei-lb-eip
fix(region): huawei lb eip sync
This commit is contained in:
@@ -1920,17 +1920,22 @@ func (self *SHuaWeiRegionDriver) RequestCreateLoadbalancer(ctx context.Context,
|
||||
return nil, errors.Wrap(err, "Huawei.RequestCreateLoadbalancer.Associate")
|
||||
}
|
||||
|
||||
eip, err := db.FetchByExternalIdAndManagerId(models.ElasticipManager, ieip.GetGlobalId(), func(q *sqlchemy.SQuery) *sqlchemy.SQuery {
|
||||
_eip, err := db.FetchByExternalIdAndManagerId(models.ElasticipManager, ieip.GetGlobalId(), func(q *sqlchemy.SQuery) *sqlchemy.SQuery {
|
||||
return q.Equals("manager_id", lb.ManagerId)
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "Huawei.RequestCreateLoadbalancer.FetchByExternalId")
|
||||
}
|
||||
eip := _eip.(*models.SElasticip)
|
||||
|
||||
err = eip.(*models.SElasticip).SyncWithCloudEip(ctx, userCred, lb.GetCloudprovider(), ieip, lb.GetOwnerId())
|
||||
err = eip.SyncWithCloudEip(ctx, userCred, lb.GetCloudprovider(), ieip, lb.GetOwnerId())
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "Huawei.RequestCreateLoadbalancer.SyncWithCloudEip")
|
||||
}
|
||||
err = eip.SyncInstanceWithCloudEip(ctx, userCred, ieip)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "SyncInstanceWithCloudEip")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user