mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #8478 from tb365/bugfix/tb-bugfix-20102301
Bugfix/tb bugfix 20102301
This commit is contained in:
@@ -271,6 +271,21 @@ func (man *SLoadbalancerManager) QueryDistinctExtraField(q *sqlchemy.SQuery, fie
|
||||
return q, httperrors.ErrNotFound
|
||||
}
|
||||
|
||||
func (man *SLoadbalancerManager) BatchCreateValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
|
||||
input := api.LoadbalancerCreateInput{}
|
||||
err := data.Unmarshal(&input)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
newData, err := man.ValidateCreateData(ctx, userCred, ownerId, query, input)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return newData, nil
|
||||
}
|
||||
|
||||
func (man *SLoadbalancerManager) ValidateCreateData(
|
||||
ctx context.Context,
|
||||
userCred mcclient.TokenCredential,
|
||||
@@ -1082,12 +1097,10 @@ func (lb *SLoadbalancer) SyncWithCloudLoadbalancer(ctx context.Context, userCred
|
||||
}
|
||||
}
|
||||
|
||||
if len(lb.ZoneId) == 0 {
|
||||
extZoneId := extLb.GetZoneId()
|
||||
if len(extZoneId) > 0 {
|
||||
if zone, err := db.FetchByExternalId(ZoneManager, extZoneId); err == nil && zone != nil {
|
||||
lb.ZoneId = zone.GetId()
|
||||
}
|
||||
extZoneId := extLb.GetZoneId()
|
||||
if len(extZoneId) > 0 {
|
||||
if zone, err := db.FetchByExternalId(ZoneManager, extZoneId); err == nil && zone != nil {
|
||||
lb.ZoneId = zone.GetId()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user