Skip to content

Commit

Permalink
Merge pull request #688 from ioito/hotfix/qx-hw-port
Browse files Browse the repository at this point in the history
fix(huawei): skip hw networkinterface sync
  • Loading branch information
ioito authored Jan 9, 2024
2 parents 76ee39a + c92192c commit 1157aa3
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions pkg/multicloud/huawei/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"strings"

"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/utils"

api "yunion.io/x/cloudmux/pkg/apis/compute"
"yunion.io/x/cloudmux/pkg/cloudprovider"
Expand Down Expand Up @@ -129,19 +128,9 @@ func (port *Port) GetICloudInterfaceAddresses() ([]cloudprovider.ICloudInterface
return address, nil
}

// 华为云端口API device_owner 变化会导致子网ip重复同步,故忽略弹性网卡同步
func (region *SRegion) GetINetworkInterfaces() ([]cloudprovider.ICloudNetworkInterface, error) {
ports, err := region.GetPorts("")
if err != nil {
return nil, err
}
ret := []cloudprovider.ICloudNetworkInterface{}
for i := 0; i < len(ports); i++ {
if len(ports[i].DeviceID) == 0 || !utils.IsInStringArray(ports[i].DeviceOwner, []string{"compute:CCI", "compute:nova", "neutron:LOADBALANCERV2"}) {
ports[i].region = region
ret = append(ret, &ports[i])
}
}
return ret, nil
return []cloudprovider.ICloudNetworkInterface{}, nil
}

// https://console.huaweicloud.com/apiexplorer/#/openapi/VPC/doc?version=v2&api=ShowPort
Expand Down

0 comments on commit 1157aa3

Please sign in to comment.