Skip to main content

reconcile_assignment

Function reconcile_assignment 

Source
pub async fn reconcile_assignment<P>(
    provider: &P,
    ip_id: &str,
    target: &FloatingIpTarget,
) -> Result<FloatingIpAssignOutcome, Error>
Expand description

Idempotent, zone-checked core shared by every provider adapter and by on_ingress_owner_changed.

  1. Fetch the floating IP’s current home zone + attachment.
  2. Refuse a cross-zone move (Hetzner/OVH/Vultr all physically cannot move an IP outside its mobility zone — W267 §Tier 1) before issuing any reassign call.
  3. If the current attachment already equals target, return reassigned: false without calling FloatingIpProvider::reassign — the ownership-flip fixture this ticket verifies against relies on this short-circuit to prove “re-applying the same owner drives ZERO reassign calls.”
  4. Otherwise call FloatingIpProvider::reassign and report reassigned: true.

Generic over ?Sized so it accepts both a concrete adapter and a &dyn FloatingIpProvider (R859-F3): cloud’s blanket FloatingIpEnvoy impl covers dyn FloatingIpProvider itself, and a &dyn cannot be re-unsized to &dyn under a Sized bound.