Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions pkg/apiserver/controllers/tunnel_agent_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ func (r *TunnelAgentReconciler) ensureConnectionAllocations(
for _, p := range newlyAllocatedPrefixes {
_ = r.agentIPAM.Release(p)
}
for _, v := range newlyAllocatedVNIs {
r.vniPool.Free(v)
for _, vni := range newlyAllocatedVNIs {
r.vniPool.Release(vni)
}
return fmt.Errorf("failed to allocate address: %w", err)
}
Expand All @@ -195,7 +195,7 @@ func (r *TunnelAgentReconciler) ensureConnectionAllocations(
_ = r.agentIPAM.Release(p)
}
for _, vni := range newlyAllocatedVNIs {
r.vniPool.Free(vni)
r.vniPool.Release(vni)
}
return fmt.Errorf("failed to allocate VNI: %w", err)
}
Expand All @@ -218,7 +218,7 @@ func (r *TunnelAgentReconciler) ensureConnectionAllocations(
_ = r.agentIPAM.Release(p)
}
for _, vni := range newlyAllocatedVNIs {
r.vniPool.Free(vni)
r.vniPool.Release(vni)
}
return err
}
Expand Down Expand Up @@ -269,9 +269,9 @@ func (r *TunnelAgentReconciler) releaseResourcesIfPresent(

// Release VNI (if set)
if conn.VNI != nil {
v := *conn.VNI
r.vniPool.Free(v)
log.Info("Released VNI", "connectionID", conn.ID, "vni", v)
vni := *conn.VNI
r.vniPool.Release(vni)
log.Info("Released VNI", "connectionID", conn.ID, "vni", vni)
conn.VNI = nil // clear in status
changed = true
}
Expand Down
Loading