Skip to content

Commit 23c82d3

Browse files
authored
Allow deleting LBs in ERROR status (kubernetes#2037)
In practice Octavia is quite an unreliable system. We should expect that load balancers will occasionally go into ERROR state for reasons as elaborate as race conditions and as simple as lack of resources to spawn a new Amphora VM. This commit makes sure that we allow deleting LBs in ERROR state, so that Services served by such LBs could be deleted and their creation retried. Obviously there's room for improvement, as we should probably detect LBs going into ERROR and attempt to delete and recreate them ourselves, but this patch is a low hanging fruit fix for the issue.
1 parent effc737 commit 23c82d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/openstack/loadbalancer.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const (
6464
defaultLoadBalancerSourceRangesIPv4 = "0.0.0.0/0"
6565
defaultLoadBalancerSourceRangesIPv6 = "::/0"
6666
activeStatus = "ACTIVE"
67+
errorStatus = "ERROR"
6768
annotationXForwardedFor = "X-Forwarded-For"
6869

6970
ServiceAnnotationLoadBalancerInternal = "service.beta.kubernetes.io/openstack-internal-load-balancer"
@@ -3462,8 +3463,8 @@ func (lbaas *LbaasV2) ensureLoadBalancerDeleted(ctx context.Context, clusterName
34623463
return nil
34633464
}
34643465

3465-
if loadbalancer.ProvisioningStatus != activeStatus {
3466-
return fmt.Errorf("load balancer %s is not ACTIVE, current provisioning status: %s", loadbalancer.ID, loadbalancer.ProvisioningStatus)
3466+
if loadbalancer.ProvisioningStatus != activeStatus && loadbalancer.ProvisioningStatus != errorStatus {
3467+
return fmt.Errorf("load balancer %s is in immutable status, current provisioning status: %s", loadbalancer.ID, loadbalancer.ProvisioningStatus)
34673468
}
34683469

34693470
if strings.HasPrefix(loadbalancer.Name, servicePrefix) {

0 commit comments

Comments
 (0)