mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix(region): vendor update (#22464)
This commit is contained in:
@@ -93,7 +93,7 @@ require (
|
||||
k8s.io/cri-api v0.22.17
|
||||
k8s.io/klog/v2 v2.20.0
|
||||
moul.io/http2curl/v2 v2.3.0
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250415104924-547fa9b8e0aa
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250427034358-3bc982fdaa5f
|
||||
yunion.io/x/executor v0.0.0-20241205080005-48f5b1212256
|
||||
yunion.io/x/jsonutils v1.0.1-0.20250406102002-98c9140a9edd
|
||||
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91
|
||||
|
||||
@@ -1376,8 +1376,8 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
|
||||
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250415104924-547fa9b8e0aa h1:x909lEcjDJns8arhUYXW75IeX0aDefEvAn4P2OFgIqE=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250415104924-547fa9b8e0aa/go.mod h1:FXxAEbdNfWXX9gjME3K2nJhkydHY5EKEUZb+RLEzVwQ=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250427034358-3bc982fdaa5f h1:UTu9vgKhS8pmLbmkNmAhLWOAPmje3Sp65BOC7LGxITc=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250427034358-3bc982fdaa5f/go.mod h1:FXxAEbdNfWXX9gjME3K2nJhkydHY5EKEUZb+RLEzVwQ=
|
||||
yunion.io/x/executor v0.0.0-20241205080005-48f5b1212256 h1:kLKQ6zbgPDQflRwoHFAjxNChcbhXIFgsUVLkJwiXu/8=
|
||||
yunion.io/x/executor v0.0.0-20241205080005-48f5b1212256/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
|
||||
Vendored
+1
-1
@@ -1785,7 +1785,7 @@ sigs.k8s.io/structured-merge-diff/v4/value
|
||||
# sigs.k8s.io/yaml v1.2.0
|
||||
## explicit; go 1.12
|
||||
sigs.k8s.io/yaml
|
||||
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250415104924-547fa9b8e0aa
|
||||
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20250427034358-3bc982fdaa5f
|
||||
## explicit; go 1.21
|
||||
yunion.io/x/cloudmux/pkg/apis
|
||||
yunion.io/x/cloudmux/pkg/apis/billing
|
||||
|
||||
+6
-8
@@ -444,19 +444,17 @@ func (host *SHost) fetchNicInfo(debug bool) []sHostNicInfo {
|
||||
}
|
||||
|
||||
for _, nic := range vnics {
|
||||
if nic.Spec.IpRouteSpec == nil {
|
||||
continue
|
||||
}
|
||||
if nic.Spec.IpRouteSpec.IpRouteConfig.GetHostIpRouteConfig() == nil {
|
||||
continue
|
||||
}
|
||||
if len(nic.Spec.IpRouteSpec.IpRouteConfig.GetHostIpRouteConfig().DefaultGateway) == 0 {
|
||||
continue
|
||||
gateway := ""
|
||||
if nic.Spec.IpRouteSpec != nil && nic.Spec.IpRouteSpec.IpRouteConfig.GetHostIpRouteConfig() != nil {
|
||||
gateway = nic.Spec.IpRouteSpec.IpRouteConfig.GetHostIpRouteConfig().DefaultGateway
|
||||
}
|
||||
// log.Debugf("vnic %d: %s %#v", i, jsonutils.Marshal(nic), nic)
|
||||
mac := netutils.FormatMacAddr(nic.Spec.Mac)
|
||||
pnic := findHostNicByMac(nicInfoList, mac)
|
||||
if pnic != nil {
|
||||
if len(pnic.IpAddr) > 0 && len(gateway) == 0 {
|
||||
continue
|
||||
}
|
||||
// findMaster = true
|
||||
pnic.IpAddr = nic.Spec.Ip.IpAddress
|
||||
pnic.IpAddrPrefixLen = mask2len(nic.Spec.Ip.SubnetMask)
|
||||
|
||||
+25
-5
@@ -16,12 +16,10 @@ package huawei
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/util/osprofile"
|
||||
|
||||
api "yunion.io/x/cloudmux/pkg/apis/compute"
|
||||
"yunion.io/x/cloudmux/pkg/cloudprovider"
|
||||
@@ -84,6 +82,9 @@ func (self *SHuaweiClient) getServerMetrics(opts *cloudprovider.MetricListOption
|
||||
}
|
||||
result := []cloudprovider.MetricValues{}
|
||||
for i := range metricData {
|
||||
if len(metricData[i].Datapoints) == 0 {
|
||||
continue
|
||||
}
|
||||
ret := cloudprovider.MetricValues{
|
||||
Id: opts.ResourceId,
|
||||
Unit: metricData[i].Unit,
|
||||
@@ -129,9 +130,6 @@ func (self *SHuaweiClient) getServerMetrics(opts *cloudprovider.MetricListOption
|
||||
}
|
||||
|
||||
func (self *SHuaweiClient) getServerAgentMetrics(opts *cloudprovider.MetricListOptions) ([]cloudprovider.MetricValues, error) {
|
||||
if strings.ToLower(opts.OsType) == strings.ToLower(osprofile.OS_TYPE_WINDOWS) {
|
||||
return []cloudprovider.MetricValues{}, nil
|
||||
}
|
||||
params := map[string]interface{}{
|
||||
"from": opts.StartTime.UnixMilli(),
|
||||
"to": opts.EndTime.UnixMilli(),
|
||||
@@ -141,6 +139,8 @@ func (self *SHuaweiClient) getServerAgentMetrics(opts *cloudprovider.MetricListO
|
||||
metrics := []interface{}{}
|
||||
namespace, dimesionName, metricNames := "AGT.ECS", "instance_id", []string{
|
||||
"mem_usedPercent",
|
||||
"cpu_usage",
|
||||
"disk_usedPercent",
|
||||
}
|
||||
for _, metricName := range metricNames {
|
||||
metrics = append(metrics, map[string]interface{}{
|
||||
@@ -166,6 +166,9 @@ func (self *SHuaweiClient) getServerAgentMetrics(opts *cloudprovider.MetricListO
|
||||
}
|
||||
result := []cloudprovider.MetricValues{}
|
||||
for i := range metricData {
|
||||
if len(metricData[i].Datapoints) == 0 {
|
||||
continue
|
||||
}
|
||||
ret := cloudprovider.MetricValues{
|
||||
Id: opts.ResourceId,
|
||||
Unit: metricData[i].Unit,
|
||||
@@ -175,6 +178,8 @@ func (self *SHuaweiClient) getServerAgentMetrics(opts *cloudprovider.MetricListO
|
||||
switch metricData[i].MetricName {
|
||||
case "mem_usedPercent":
|
||||
ret.MetricType = cloudprovider.VM_METRIC_TYPE_MEM_USAGE
|
||||
case "cpu_usage":
|
||||
ret.MetricType = cloudprovider.VM_METRIC_TYPE_CPU_USAGE
|
||||
case "disk_usedPercent":
|
||||
ret.MetricType = cloudprovider.VM_METRIC_TYPE_DISK_USAGE
|
||||
default:
|
||||
@@ -237,6 +242,9 @@ func (self *SHuaweiClient) getRedisMetrics(opts *cloudprovider.MetricListOptions
|
||||
}
|
||||
result := []cloudprovider.MetricValues{}
|
||||
for i := range metricData {
|
||||
if len(metricData[i].Datapoints) == 0 {
|
||||
continue
|
||||
}
|
||||
ret := cloudprovider.MetricValues{
|
||||
Id: opts.ResourceId,
|
||||
Unit: metricData[i].Unit,
|
||||
@@ -333,6 +341,9 @@ func (self *SHuaweiClient) getRdsMetrics(opts *cloudprovider.MetricListOptions)
|
||||
}
|
||||
result := []cloudprovider.MetricValues{}
|
||||
for i := range metricData {
|
||||
if len(metricData[i].Datapoints) == 0 {
|
||||
continue
|
||||
}
|
||||
ret := cloudprovider.MetricValues{
|
||||
Id: opts.ResourceId,
|
||||
Unit: metricData[i].Unit,
|
||||
@@ -422,6 +433,9 @@ func (self *SHuaweiClient) getBucketMetrics(opts *cloudprovider.MetricListOption
|
||||
}
|
||||
result := []cloudprovider.MetricValues{}
|
||||
for i := range metricData {
|
||||
if len(metricData[i].Datapoints) == 0 {
|
||||
continue
|
||||
}
|
||||
ret := cloudprovider.MetricValues{
|
||||
Id: opts.ResourceId,
|
||||
Unit: metricData[i].Unit,
|
||||
@@ -503,6 +517,9 @@ func (self *SHuaweiClient) getLoadbalancerMetrics(opts *cloudprovider.MetricList
|
||||
}
|
||||
result := []cloudprovider.MetricValues{}
|
||||
for i := range metricData {
|
||||
if len(metricData[i].Datapoints) == 0 {
|
||||
continue
|
||||
}
|
||||
ret := cloudprovider.MetricValues{
|
||||
Id: opts.ResourceId,
|
||||
Unit: metricData[i].Unit,
|
||||
@@ -556,6 +573,9 @@ func (self *SHuaweiClient) getModelartsPoolMetrics(opts *cloudprovider.MetricLis
|
||||
}
|
||||
result := []cloudprovider.MetricValues{}
|
||||
for i := range metricData {
|
||||
if len(metricData[i].Datapoints) == 0 {
|
||||
continue
|
||||
}
|
||||
isMB := false
|
||||
if metricData[i].Datapoints[0].Unit == "Megabytes" {
|
||||
isMB = true
|
||||
|
||||
Reference in New Issue
Block a user