From 12ec296cd12d10489996d7877e4d4d3adfbf4f00 Mon Sep 17 00:00:00 2001 From: Qu Xuan Date: Mon, 30 Dec 2019 14:52:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=81=BF=E5=85=8D=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=B0=86eip=E5=90=8C=E6=AD=A5=E5=88=B0=E5=BC=B9=E6=80=A7?= =?UTF-8?q?=E7=BD=91=E5=8D=A1=E9=87=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/multicloud/openstack/port.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/multicloud/openstack/port.go b/pkg/multicloud/openstack/port.go index 973b812648..e260e18619 100644 --- a/pkg/multicloud/openstack/port.go +++ b/pkg/multicloud/openstack/port.go @@ -20,6 +20,7 @@ import ( "time" "yunion.io/x/pkg/errors" + "yunion.io/x/pkg/utils" api "yunion.io/x/onecloud/pkg/apis/compute" "yunion.io/x/onecloud/pkg/cloudprovider" @@ -149,7 +150,10 @@ func (region *SRegion) GetINetworkInterfaces() ([]cloudprovider.ICloudNetworkInt } ret := []cloudprovider.ICloudNetworkInterface{} for i := 0; i < len(ports); i++ { - if len(ports[i].DeviceID) == 0 || ports[i].DeviceOwner != "compute:nova" { + if len(ports[i].DeviceID) == 0 || !utils.IsInStringArray(ports[i].DeviceOwner, []string{ + "compute:nova", //instance ip addr + "network:floatingip", //float ip addr + }) { ports[i].region = region ret = append(ret, &ports[i]) }