mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-02 17:57:33 +00:00
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: Eunsoo Park <esevan.park@gmail.com>
This commit is contained in:
@@ -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}}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user