Skip to content

Commit

Permalink
huawei network id fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tangbin committed May 9, 2020
1 parent ffd8ab6 commit 002a618
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/compute/models/loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,8 @@ func (lb *SLoadbalancer) SyncWithCloudLoadbalancer(ctx context.Context, userCred
lb.EgressMbps = extLb.GetEgressMbps()
lb.ChargeType = extLb.GetChargeType()
lb.ManagerId = provider.Id

lbNetworkIds := getExtLbNetworkIds(extLb)
lb.NetworkId = strings.Join(lbNetworkIds, ",")
if extLb.GetMetadata() != nil {
lb.LBInfo = extLb.GetMetadata()
}
Expand Down
7 changes: 6 additions & 1 deletion pkg/multicloud/huawei/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ func (self *SLoadbalancer) GetNetworkType() string {
}

func (self *SLoadbalancer) GetNetworkIds() []string {
return []string{self.VipSubnetID}
net := self.GetNetwork()
if net != nil {
return []string{net.GetId()}
}

return []string{}
}

func (self *SLoadbalancer) GetNetwork() *SNetwork {
Expand Down

0 comments on commit 002a618

Please sign in to comment.