Commit e5b7f0e7 authored by FengyunPan's avatar FengyunPan

Fix legacy floatingip

If user specify floating-network-id by annotation rather than cloud provider file, openstack cloud provider don't delete floatingip when deleting LoadBalancer service.
parent e633a160
...@@ -1116,7 +1116,7 @@ func (lbaas *LbaasV2) EnsureLoadBalancerDeleted(clusterName string, service *v1. ...@@ -1116,7 +1116,7 @@ func (lbaas *LbaasV2) EnsureLoadBalancerDeleted(clusterName string, service *v1.
return nil return nil
} }
if lbaas.opts.FloatingNetworkId != "" && loadbalancer != nil { if loadbalancer != nil && loadbalancer.VipPortID != "" {
portID := loadbalancer.VipPortID portID := loadbalancer.VipPortID
floatingIP, err := getFloatingIPByPortID(lbaas.network, portID) floatingIP, err := getFloatingIPByPortID(lbaas.network, portID)
if err != nil && err != ErrNotFound { if err != nil && err != ErrNotFound {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment