Skip to content

Commit

Permalink
fix(vmip): fix bug of creating two VirtualMachineIPAddress with the s…
Browse files Browse the repository at this point in the history
…ame name in different namespaces (#287)

Signed-off-by: Dmitry Lopatin <[email protected]>
  • Loading branch information
LopatinDmitr authored Aug 14, 2024
1 parent cea1607 commit af7dd97
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ func (s *state) VirtualMachineIPLease(ctx context.Context) (*virtv2.VirtualMachi

if s.lease == nil {
var leases virtv2.VirtualMachineIPAddressLeaseList
err = s.client.List(ctx, &leases, &client.MatchingFields{
indexer.IndexFieldVMIPLeaseByVMIP: s.vmip.Name,
})
err = s.client.List(ctx, &leases,
client.InNamespace(s.vmip.Namespace),
&client.MatchingFields{
indexer.IndexFieldVMIPLeaseByVMIP: s.vmip.Name,
})
if err != nil {
return nil, err
}
Expand Down

0 comments on commit af7dd97

Please sign in to comment.