Commit da5618e6 authored by Eunsoo Park's avatar Eunsoo Park

Fixup openstack cloud provider loadbalancer deletion error

This change enables ```getLoadBalancer``` to return the loadbalancer even if no floating ip is associated to the VIP port of the loadbalancer. Signed-off-by: 's avatarEunsoo Park <esevan.park@gmail.com>
parent 058b26f3
...@@ -474,10 +474,13 @@ func (lbaas *LbaasV2) GetLoadBalancer(ctx context.Context, clusterName string, s ...@@ -474,10 +474,13 @@ func (lbaas *LbaasV2) GetLoadBalancer(ctx context.Context, clusterName string, s
portID := loadbalancer.VipPortID portID := loadbalancer.VipPortID
if portID != "" { if portID != "" {
floatIP, err := getFloatingIPByPortID(lbaas.network, portID) floatIP, err := getFloatingIPByPortID(lbaas.network, portID)
if err != nil { if err != nil && err != ErrNotFound {
return nil, false, fmt.Errorf("error getting floating ip for port %s: %v", portID, err) return nil, false, fmt.Errorf("error getting floating ip for port %s: %v", portID, err)
} }
status.Ingress = []v1.LoadBalancerIngress{{IP: floatIP.FloatingIP}}
if floatIP != nil {
status.Ingress = []v1.LoadBalancerIngress{{IP: floatIP.FloatingIP}}
}
} else { } else {
status.Ingress = []v1.LoadBalancerIngress{{IP: loadbalancer.VipAddress}} status.Ingress = []v1.LoadBalancerIngress{{IP: loadbalancer.VipAddress}}
} }
......
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