From 9958389eb9771bb964f6e01ce04c27129c6c4417 Mon Sep 17 00:00:00 2001 From: FengyunPan Date: Fri, 12 Jan 2018 18:57:46 +0800 Subject: [PATCH] The lbaas.opts.SubnetId should be set by subnet id. Fix #58145 The getSubnetIDForLB() should return subnet id rather than net id. --- pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go b/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go index 036af670bc7..c605dd19e64 100644 --- a/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go +++ b/pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go @@ -537,7 +537,7 @@ func getSubnetIDForLB(compute *gophercloud.ServiceClient, node v1.Node) (string, for _, intf := range interfaces { for _, fixedIP := range intf.FixedIPs { if fixedIP.IPAddress == ipAddress { - return intf.NetID, nil + return fixedIP.SubnetID, nil } } }