Skip to content

Commit

Permalink
elasticips: filter by owner when doing auto allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
yousong committed Sep 12, 2020
1 parent 2a3464e commit ef8b9e6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/compute/models/elasticips.go
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,7 @@ func (manager *SElasticipManager) NewEipForVMOnHost(ctx context.Context, userCre
wireq := WireManager.Query().SubQuery()
hostwireq := HostwireManager.Query().SubQuery()
q := NetworkManager.Query()
q = NetworkManager.FilterByOwner(q, userCred, NetworkManager.NamespaceScope())
q = q.Join(wireq, sqlchemy.Equals(wireq.Field("id"), q.Field("wire_id")))
q = q.Join(hostwireq, sqlchemy.Equals(hostwireq.Field("wire_id"), wireq.Field("id")))
q = q.Join(hostq, sqlchemy.Equals(hostq.Field("id"), host.Id))
Expand Down

0 comments on commit ef8b9e6

Please sign in to comment.