fix: unify lb charge type (#24271)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2026-02-08 18:43:03 +08:00
committed by GitHub
co-authored by Qiu Jian
parent cc3a44634b
commit 21ec090203
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -112,7 +112,7 @@ type SLoadbalancer struct {
SLoadbalancerClusterResourceBase
// 计费类型
ChargeType string `list:"user" get:"user" create:"optional" update:"user" json:"charge_type"`
SBillingChargeTypeBase
// 套餐名称
LoadbalancerSpec string `list:"user" get:"user" list:"user" create:"optional" json:"loadbalancer_spec"`
@@ -1138,7 +1138,7 @@ func (region *SCloudregion) newFromCloudLoadbalancer(ctx context.Context, userCr
lb.Status = ext.GetStatus()
lb.LoadbalancerSpec = ext.GetLoadbalancerSpec()
lb.ChargeType = ext.GetChargeType()
lb.ChargeType = billing_api.ParseNetChargeType(ext.GetChargeType())
lb.EgressMbps = ext.GetEgressMbps()
lb.ExternalId = ext.GetGlobalId()
lbNetworkIds := getExtLbNetworkIds(ext, lb.ManagerId)
@@ -1458,7 +1458,7 @@ func (lb *SLoadbalancer) syncWithCloudLoadbalancer(ctx context.Context, userCred
lb.Status = ext.GetStatus()
lb.LoadbalancerSpec = ext.GetLoadbalancerSpec()
lb.EgressMbps = ext.GetEgressMbps()
lb.ChargeType = ext.GetChargeType()
lb.ChargeType = billing_api.ParseNetChargeType(ext.GetChargeType())
lbNetworkIds := getExtLbNetworkIds(ext, lb.ManagerId)
lb.NetworkId = strings.Join(lbNetworkIds, ",")
if len(lb.VpcId) == 0 {
+1 -1
View File
@@ -143,7 +143,7 @@ func (self *SManagedVirtualizationRegionDriver) RequestCreateLoadbalancerInstanc
Desc: lb.Description,
Address: lb.Address,
AddressType: lb.AddressType,
ChargeType: lb.ChargeType,
ChargeType: string(lb.ChargeType),
EgressMbps: lb.EgressMbps,
LoadbalancerSpec: lb.LoadbalancerSpec,
}