Skip to content

Commit

Permalink
lxd/network/zone: Ignore gateway leases when necessary
Browse files Browse the repository at this point in the history
We do want gateway Leases to show when listing them for a project if the network is visible from that project. However, when dealing with DNS zone configuration, we only want to consider these leases when dealing with the network's original project.

Signed-off-by: hamistao <[email protected]>
  • Loading branch information
hamistao committed Oct 23, 2024
1 parent 08860ab commit d46f1fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lxd/network/zone/zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,12 @@ func (d *zone) getProjectRecords(projectName string, n network.Network, recordGe

// Convert leases to usable PTR records.
for _, lease := range leases {
// Since networks can be visible from more than one project
// We don't want to consider gateway leases unless dealing with the network's project,
if projectName != n.Project() && lease.Type == "gateway" {
continue
}

ip := net.ParseIP(lease.Address)

// Get the record.
Expand Down

0 comments on commit d46f1fc

Please sign in to comment.