You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated cluster mapper in internal/server/db/cluster/networks_peers.mapper.go already includes a prepared statement specifically for this lookup: networkPeerObjectsByNetworkIDAndTargetNetworkProjectAndTargetNetworkName
(matching NetworkID, TargetNetworkProject, and TargetNetworkName).
By looking up targetNetID via tx.GetNetworkID(ctx, peer.TargetProject, peer.TargetNetwork), PeerCreate can pass NetworkID: &targetNetID to scope the search directly to the intended peer network. In PeerDelete, only the reciprocal peer matching dbPeer.TargetNetworkID should be cleared.
Activity
jochumdev commentedon Sep 13, 2026
LLM Proposed Fix / Patch
The generated cluster mapper in
internal/server/db/cluster/networks_peers.mapper.goalready includes a prepared statement specifically for this lookup:networkPeerObjectsByNetworkIDAndTargetNetworkProjectAndTargetNetworkName(matching
NetworkID,TargetNetworkProject, andTargetNetworkName).By looking up
targetNetIDviatx.GetNetworkID(ctx, peer.TargetProject, peer.TargetNetwork),PeerCreatecan passNetworkID: &targetNetIDto scope the search directly to the intended peer network. InPeerDelete, only the reciprocal peer matchingdbPeer.TargetNetworkIDshould be cleared.incusd/network/ovn: Scope mutual peer lookups to the target network
incusd/network/ovn: Scope mutual peer lookups to the target network