diff --git a/go.mod b/go.mod index 1e8327905b9..d35d5638137 100644 --- a/go.mod +++ b/go.mod @@ -87,7 +87,7 @@ require ( k8s.io/client-go v0.19.3 k8s.io/cluster-bootstrap v0.19.3 moul.io/http2curl/v2 v2.3.0 - yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241107063324-12e4e04c9238 + yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241120063047-cb7d8075945b yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 yunion.io/x/jsonutils v1.0.1-0.20240930100528-1671a2d0d22f yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91 diff --git a/go.sum b/go.sum index 667bfc3fca8..c4e4c54ec3d 100644 --- a/go.sum +++ b/go.sum @@ -1274,8 +1274,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.20241107063324-12e4e04c9238 h1:L5SDrUPg+pgFO8CPuaTlODjeGL3/ZsLCMMC0H6qWWtg= -yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241107063324-12e4e04c9238/go.mod h1:rj/pb3DitJlQaQD8UW1oxx/KD+PzDZqoywzqRJaFE9A= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241120063047-cb7d8075945b h1:n4cMdSOdGQJrbHwzYMQ+4hTKmm7R6g6y+iCfV2lYQLY= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241120063047-cb7d8075945b/go.mod h1:rj/pb3DitJlQaQD8UW1oxx/KD+PzDZqoywzqRJaFE9A= yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug= yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws= yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634= diff --git a/pkg/apis/compute/cloudaccount_const.go b/pkg/apis/compute/cloudaccount_const.go index 49323094534..a19f7e39488 100644 --- a/pkg/apis/compute/cloudaccount_const.go +++ b/pkg/apis/compute/cloudaccount_const.go @@ -83,7 +83,6 @@ const ( CLOUD_PROVIDER_HEALTH_UNKNOWN = compute.CLOUD_PROVIDER_HEALTH_UNKNOWN // 未知状态,查询失败 CLOUD_PROVIDER_HEALTH_NO_PERMISSION = compute.CLOUD_PROVIDER_HEALTH_NO_PERMISSION // 没有权限获取账单信息 - ZSTACK_BRAND_DSTACK = compute.ZSTACK_BRAND_DSTACK ONECLOUD_BRAND_ONECLOUD = "OneCloud" CLOUD_ACCOUNT_WIRE_LEVEL_VCENTER = "vcenter" diff --git a/pkg/compute/regiondrivers/azure.go b/pkg/compute/regiondrivers/azure.go index 28d2532b787..03e4b4ce2b1 100644 --- a/pkg/compute/regiondrivers/azure.go +++ b/pkg/compute/regiondrivers/azure.go @@ -104,6 +104,6 @@ func (self *SAzureRegionDriver) ValidateUpdateSecurityGroupRuleInput(ctx context func (self *SAzureRegionDriver) GetSecurityGroupFilter(vpc *models.SVpc) (func(q *sqlchemy.SQuery) *sqlchemy.SQuery, error) { return func(q *sqlchemy.SQuery) *sqlchemy.SQuery { - return q.Equals("cloudregion_id", vpc.CloudregionId) + return q.Equals("cloudregion_id", vpc.CloudregionId).Equals("manager_id", vpc.ManagerId) }, nil } diff --git a/pkg/compute/regiondrivers/bingocloud.go b/pkg/compute/regiondrivers/bingocloud.go index f82dc2b39ef..0cc97d01d7f 100644 --- a/pkg/compute/regiondrivers/bingocloud.go +++ b/pkg/compute/regiondrivers/bingocloud.go @@ -63,6 +63,6 @@ func (self *SBingoCloudRegionDriver) ValidateUpdateSecurityGroupRuleInput(ctx co func (self *SBingoCloudRegionDriver) GetSecurityGroupFilter(vpc *models.SVpc) (func(q *sqlchemy.SQuery) *sqlchemy.SQuery, error) { return func(q *sqlchemy.SQuery) *sqlchemy.SQuery { - return q.Equals("cloudregion_id", vpc.CloudregionId) + return q.Equals("cloudregion_id", vpc.CloudregionId).Equals("manager_id", vpc.ManagerId) }, nil } diff --git a/pkg/compute/regiondrivers/ctyun.go b/pkg/compute/regiondrivers/ctyun.go index 600963d5cea..0468c594fed 100644 --- a/pkg/compute/regiondrivers/ctyun.go +++ b/pkg/compute/regiondrivers/ctyun.go @@ -84,6 +84,6 @@ func (self *SCtyunRegionDriver) ValidateUpdateSecurityGroupRuleInput(ctx context func (self *SCtyunRegionDriver) GetSecurityGroupFilter(vpc *models.SVpc) (func(q *sqlchemy.SQuery) *sqlchemy.SQuery, error) { return func(q *sqlchemy.SQuery) *sqlchemy.SQuery { - return q.Equals("cloudregion_id", vpc.CloudregionId) + return q.Equals("cloudregion_id", vpc.CloudregionId).Equals("manager_id", vpc.ManagerId) }, nil } diff --git a/pkg/compute/regiondrivers/qcloud.go b/pkg/compute/regiondrivers/qcloud.go index 9d0ac7885c3..d657f5a9bd8 100644 --- a/pkg/compute/regiondrivers/qcloud.go +++ b/pkg/compute/regiondrivers/qcloud.go @@ -590,6 +590,6 @@ func (self *SQcloudRegionDriver) ValidateUpdateSecurityGroupRuleInput(ctx contex func (self *SQcloudRegionDriver) GetSecurityGroupFilter(vpc *models.SVpc) (func(q *sqlchemy.SQuery) *sqlchemy.SQuery, error) { return func(q *sqlchemy.SQuery) *sqlchemy.SQuery { - return q.Equals("cloudregion_id", vpc.CloudregionId) + return q.Equals("cloudregion_id", vpc.CloudregionId).Equals("manager_id", vpc.ManagerId) }, nil } diff --git a/pkg/compute/regiondrivers/ucloud.go b/pkg/compute/regiondrivers/ucloud.go index cc98372f6d5..28c2965f9f4 100644 --- a/pkg/compute/regiondrivers/ucloud.go +++ b/pkg/compute/regiondrivers/ucloud.go @@ -91,6 +91,6 @@ func (self *SUcloudRegionDriver) ValidateUpdateSecurityGroupRuleInput(ctx contex func (self *SUcloudRegionDriver) GetSecurityGroupFilter(vpc *models.SVpc) (func(q *sqlchemy.SQuery) *sqlchemy.SQuery, error) { return func(q *sqlchemy.SQuery) *sqlchemy.SQuery { - return q.Equals("cloudregion_id", vpc.CloudregionId) + return q.Equals("cloudregion_id", vpc.CloudregionId).Equals("manager_id", vpc.ManagerId) }, nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index 4528dec6e0d..43819bb87f4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1576,7 +1576,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.20241107063324-12e4e04c9238 +# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20241120063047-cb7d8075945b ## explicit; go 1.21 yunion.io/x/cloudmux/pkg/apis yunion.io/x/cloudmux/pkg/apis/billing diff --git a/vendor/yunion.io/x/cloudmux/pkg/apis/compute/cloudaccount_const.go b/vendor/yunion.io/x/cloudmux/pkg/apis/compute/cloudaccount_const.go index 7b8e35a8a49..f850f0c90ba 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/apis/compute/cloudaccount_const.go +++ b/vendor/yunion.io/x/cloudmux/pkg/apis/compute/cloudaccount_const.go @@ -57,8 +57,6 @@ const ( CLOUD_PROVIDER_HEALTH_ARREARS = "arrears" // 远端处于欠费状态 CLOUD_PROVIDER_HEALTH_UNKNOWN = "unknown" // 未知状态,查询失败 CLOUD_PROVIDER_HEALTH_NO_PERMISSION = "no permission" // 没有权限获取账单信息 - - ZSTACK_BRAND_DSTACK = "DStack" ) const ( diff --git a/vendor/yunion.io/x/cloudmux/pkg/multicloud/azure/host.go b/vendor/yunion.io/x/cloudmux/pkg/multicloud/azure/host.go index 59df7c49cb4..b5497152d3b 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/multicloud/azure/host.go +++ b/vendor/yunion.io/x/cloudmux/pkg/multicloud/azure/host.go @@ -72,7 +72,14 @@ func (self *SHost) CreateVM(desc *cloudprovider.SManagedVMCreateConfig) (cloudpr instance, err := self.zone.region._createVM(desc, nic.ID) if err != nil { - self.zone.region.DeleteNetworkInterface(nic.ID) + cloudprovider.Wait(time.Minute*2, time.Minute*6, func() (bool, error) { + e := self.zone.region.DeleteNetworkInterface(nic.ID) + if e == nil { + return true, nil + } + log.Errorf("delete nic %s error: %v", nic.ID, err) + return false, nil + }) return nil, err } instance.host = self @@ -122,7 +129,8 @@ func (self *SRegion) _createVM(desc *cloudprovider.SManagedVMCreateConfig, nicId "NetworkProfile": map[string]interface{}{ "NetworkInterfaces": []map[string]string{ map[string]string{ - "Id": nicId, + "Id": nicId, + "deleteOption": "Delete", }, }, }, diff --git a/vendor/yunion.io/x/cloudmux/pkg/multicloud/zstack/provider/provider.go b/vendor/yunion.io/x/cloudmux/pkg/multicloud/zstack/provider/provider.go index 46b0b073747..dc6b95664f3 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/multicloud/zstack/provider/provider.go +++ b/vendor/yunion.io/x/cloudmux/pkg/multicloud/zstack/provider/provider.go @@ -38,7 +38,7 @@ func (self *SZStackProviderFactory) GetName() string { } func (self *SZStackProviderFactory) GetSupportedBrands() []string { - return []string{api.ZSTACK_BRAND_DSTACK} + return []string{} } func (self *SZStackProviderFactory) ValidateCreateCloudaccountData(ctx context.Context, input cloudprovider.SCloudaccountCredential) (cloudprovider.SCloudaccount, error) {