Skip to content

Commit b0b66c5

Browse files
authored
fix(loadbalancer): Move deletion of security groups before lb delete
1 parent a031201 commit b0b66c5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

pkg/openstack/loadbalancer.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,6 +2151,12 @@ func (lbaas *LbaasV2) ensureLoadBalancerDeleted(ctx context.Context, clusterName
21512151
}
21522152
}
21532153

2154+
// Delete the Security Group. We're doing that even if `manage-security-groups` is disabled to make sure we don't
2155+
// orphan created SGs even if CPO got reconfigured.
2156+
if err := lbaas.ensureSecurityGroupDeleted(ctx, service); err != nil {
2157+
return err
2158+
}
2159+
21542160
if err = lbaas.deleteLoadBalancer(ctx, loadbalancer, service, svcConf, needDeleteLB); err != nil {
21552161
return err
21562162
}
@@ -2174,12 +2180,6 @@ func (lbaas *LbaasV2) ensureLoadBalancerDeleted(ctx context.Context, clusterName
21742180
klog.InfoS("Updated load balancer tags", "lbID", loadbalancer.ID)
21752181
}
21762182

2177-
// Delete the Security Group. We're doing that even if `manage-security-groups` is disabled to make sure we don't
2178-
// orphan created SGs even if CPO got reconfigured.
2179-
if err := lbaas.ensureSecurityGroupDeleted(ctx, service); err != nil {
2180-
return err
2181-
}
2182-
21832183
return nil
21842184
}
21852185

0 commit comments

Comments
 (0)