Skip to content

Commit

Permalink
Do not check whether subnet is failed or not on release when checking…
Browse files Browse the repository at this point in the history
… for reserved cidr
  • Loading branch information
aiivashchenko committed Jun 17, 2022
1 parent f8eadd0 commit 803e4f0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions controllers/subnet_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,8 @@ func (r *SubnetReconciler) SetupWithManager(mgr ctrl.Manager) error {
func (r *SubnetReconciler) finalizeSubnet(ctx context.Context, log logr.Logger, namespacedName types.NamespacedName, subnet *v1alpha1.Subnet) error {
// If subnet has failed to reserve the CIDR
// it may be released
if subnet.Status.Reserved == nil &&
subnet.Status.State == v1alpha1.CFailedSubnetState {
log.Info("releasing failed subnet", "name", namespacedName)
if subnet.Status.Reserved == nil {
log.Info("subnet hasn't been booked, releasing", "name", namespacedName)
return nil
}

Expand Down

0 comments on commit 803e4f0

Please sign in to comment.